sdk/containerservice/arm-containerservice/samples-dev/managedClustersStartSample.ts (22 lines of code) (raw):
/*
* 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 { ContainerServiceClient } from "@azure/arm-containerservice";
import { DefaultAzureCredential } from "@azure/identity";
import "dotenv/config";
/**
* This sample demonstrates how to See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster.
*
* @summary See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-02-02-preview/examples/ManagedClustersStart.json
*/
async function startManagedCluster(): Promise<void> {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.beginStartAndWait(
resourceGroupName,
resourceName,
);
console.log(result);
}
async function main(): Promise<void> {
await startManagedCluster();
}
main().catch(console.error);