Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@azure/arm-cognitiveservices
Advanced tools
CognitiveServicesManagementClient Library with typescript type definitions for node.js and browser.
This package contains an isomorphic SDK for CognitiveServicesManagementClient.
npm install @azure/arm-cognitiveservices
npm install @azure/ms-rest-nodeauth
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { CognitiveServicesManagementClient, CognitiveServicesManagementModels, CognitiveServicesManagementMappers } from "@azure/arm-cognitiveservices";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new CognitiveServicesManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const accountName = "testaccountName";
client.accounts.getProperties(resourceGroupName, accountName).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
npm install @azure/ms-rest-browserauth
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/arm-cognitiveservices sample</title>
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/arm-cognitiveservices/dist/arm-cognitiveservices.js"></script>
<script type="text/javascript">
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>"
});
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
// may cause redirects
authManager.login();
}
const client = new Azure.ArmCognitiveservices.CognitiveServicesManagementClient(res.creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const accountName = "testaccountName";
client.accounts.getProperties(resourceGroupName, accountName).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log("An error occurred:");
console.error(err);
});
});
</script>
</head>
<body></body>
</html>
FAQs
A generated SDK for CognitiveServicesManagementClient.
The npm package @azure/arm-cognitiveservices receives a total of 4,286 weekly downloads. As such, @azure/arm-cognitiveservices popularity was classified as popular.
We found that @azure/arm-cognitiveservices demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.