mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
/**
|
|
* This sample demonstrates how to Deletes a machine learning team account.
|
|
*
|
|
* @summary Deletes a machine learning team account.
|
|
* x-ms-original-file: specification/machinelearningexperimentation/resource-manager/Microsoft.MachineLearningExperimentation/preview/2017-05-01-preview/examples/DeleteAccount.json
|
|
*/
|
|
|
|
import { MLTeamAccountManagementClient } from "@azure/arm-machinelearningexperimentation";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
import "dotenv/config";
|
|
|
|
async function accountDelete(): Promise<void> {
|
|
const subscriptionId =
|
|
process.env["MACHINELEARNINGEXPERIMENTATION_SUBSCRIPTION_ID"] ||
|
|
"00000000-0000-0000-0000-000000000000";
|
|
const resourceGroupName =
|
|
process.env["MACHINELEARNINGEXPERIMENTATION_RESOURCE_GROUP"] || "myResourceGroup";
|
|
const accountName = "myAccount";
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new MLTeamAccountManagementClient(credential, subscriptionId);
|
|
const result = await client.accounts.delete(resourceGroupName, accountName);
|
|
console.log(result);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await accountDelete();
|
|
}
|
|
|
|
main().catch(console.error);
|