mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
Configurations: 'specification/developerhub/resource-manager/Microsoft.DevHub/DeveloperHub/tspconfig.yaml', API Version: 2025-03-01-preview, SDK Release Type: beta, and CommitSHA: '4270ac9d4ba3f3bb031b01f5773208d7d4827a9e' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6392787 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --------- Co-authored-by: Jiao Di (MSFT) <[email protected]>
26 lines
809 B
TypeScript
26 lines
809 B
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
import { DeveloperHubServiceClient } from "@azure/arm-devhub";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
/**
|
|
* This sample demonstrates how to gets a list of supported templates.
|
|
*
|
|
* @summary gets a list of supported templates.
|
|
* x-ms-original-file: 2025-03-01-preview/Template_Get.json
|
|
*/
|
|
async function getTemplates(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "a0a37f63-7183-4e86-9ac7-ce8036a3ed31";
|
|
const client = new DeveloperHubServiceClient(credential, subscriptionId);
|
|
const result = await client.template.get("test-template");
|
|
console.log(result);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await getTemplates();
|
|
}
|
|
|
|
main().catch(console.error);
|