sdk/containerservice/arm-containerservice/samples-dev/privateLinkResourcesListSample.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 To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters * * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-02-02-preview/examples/PrivateLinkResourcesList.json */ async function listPrivateLinkResourcesByManagedCluster(): 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.privateLinkResources.list( resourceGroupName, resourceName, ); console.log(result); } async function main(): Promise<void> { await listPrivateLinkResourcesByManagedCluster(); } main().catch(console.error);