mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
/**
|
|
* This sample demonstrates how to Returns list of operations supported by the Microsoft.SecurityDevOps provider.
|
|
*
|
|
* @summary Returns list of operations supported by the Microsoft.SecurityDevOps provider.
|
|
* x-ms-original-file: specification/securitydevops/resource-manager/Microsoft.SecurityDevOps/preview/2022-09-01-preview/examples/OperationsList.json
|
|
*/
|
|
|
|
import { MicrosoftSecurityDevOps } from "@azure/arm-securitydevops";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
import "dotenv/config";
|
|
|
|
async function operationsList(): Promise<void> {
|
|
const subscriptionId =
|
|
process.env["SECURITYDEVOPS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new MicrosoftSecurityDevOps(credential, subscriptionId);
|
|
const resArray = new Array();
|
|
for await (const item of client.operations.list()) {
|
|
resArray.push(item);
|
|
}
|
|
console.log(resArray);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await operationsList();
|
|
}
|
|
|
|
main().catch(console.error);
|