Files

35 lines
1.4 KiB
TypeScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* This sample demonstrates how to Lists all the available machine learning team accounts under the specified resource group.
*
* @summary Lists all the available machine learning team accounts under the specified resource group.
* x-ms-original-file: specification/machinelearningexperimentation/resource-manager/Microsoft.MachineLearningExperimentation/preview/2017-05-01-preview/examples/ListAccountResourceGroup.json
*/
import { MLTeamAccountManagementClient } from "@azure/arm-machinelearningexperimentation";
import { DefaultAzureCredential } from "@azure/identity";
import "dotenv/config";
async function accountListByResourceGroup(): Promise<void> {
const subscriptionId =
process.env["MACHINELEARNINGEXPERIMENTATION_SUBSCRIPTION_ID"] ||
"00000000-1111-2222-3333-444444444444";
const resourceGroupName =
process.env["MACHINELEARNINGEXPERIMENTATION_RESOURCE_GROUP"] || "accountcrud-1234";
const credential = new DefaultAzureCredential();
const client = new MLTeamAccountManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.accounts.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
async function main(): Promise<void> {
await accountListByResourceGroup();
}
main().catch(console.error);