mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
/**
|
|
* This sample demonstrates how to Delete a LoadTest resource.
|
|
*
|
|
* @summary Delete a LoadTest resource.
|
|
* x-ms-original-file: specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_Delete.json
|
|
*/
|
|
|
|
import { LoadTestClient } from "@azure/arm-loadtesting";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
import "dotenv/config";
|
|
|
|
async function loadTestsDelete(): Promise<void> {
|
|
const subscriptionId =
|
|
process.env["LOADTESTSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
|
|
const resourceGroupName = process.env["LOADTESTSERVICE_RESOURCE_GROUP"] || "dummyrg";
|
|
const loadTestName = "myLoadTest";
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new LoadTestClient(credential, subscriptionId);
|
|
const result = await client.loadTests.beginDeleteAndWait(resourceGroupName, loadTestName);
|
|
console.log(result);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await loadTestsDelete();
|
|
}
|
|
|
|
main().catch(console.error);
|