mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
31 lines
883 B
TypeScript
31 lines
883 B
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
/**
|
|
* This sample demonstrates how to list the operations for the provider
|
|
*
|
|
* @summary list the operations for the provider
|
|
* x-ms-original-file: 2024-10-19/ListOperations.json
|
|
*/
|
|
|
|
import { DevOpsInfrastructureClient } from "@azure/arm-devopsinfrastructure";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
async function operationsList(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "00000000-0000-0000-0000-00000000000";
|
|
const client = new DevOpsInfrastructureClient(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);
|