azure-sdk-for-js/sdk/devcenter/arm-devcenter/samples-dev/devCentersDeleteSample.ts

43 строки
1.3 KiB
TypeScript

/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { DevCenterClient } from "@azure/arm-devcenter";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes a devcenter
*
* @summary Deletes a devcenter
* x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevCenters_Delete.json
*/
async function devCentersDelete() {
const subscriptionId =
process.env["DEVCENTER_SUBSCRIPTION_ID"] ||
"0ac520ee-14c0-480f-b6c9-0a90c58ffff";
const resourceGroupName = process.env["DEVCENTER_RESOURCE_GROUP"] || "rg1";
const devCenterName = "Contoso";
const credential = new DefaultAzureCredential();
const client = new DevCenterClient(credential, subscriptionId);
const result = await client.devCenters.beginDeleteAndWait(
resourceGroupName,
devCenterName,
);
console.log(result);
}
async function main() {
devCentersDelete();
}
main().catch(console.error);