mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
/**
|
|
* This sample demonstrates how to Updates the tags of the specified Team Services project.
|
|
*
|
|
* @summary Updates the tags of the specified Team Services project.
|
|
* x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateProjectResource.json
|
|
*/
|
|
|
|
import type { ProjectResource } from "@azure/arm-visualstudio";
|
|
import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
async function updateAProjectResource(): Promise<void> {
|
|
const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90";
|
|
const resourceGroupName = "VS-Example-Group";
|
|
const rootResourceName = "ExampleAccount";
|
|
const resourceName = "ExampleProject";
|
|
const body: ProjectResource = {
|
|
name: "ms.example",
|
|
type: "Microsoft.VisualStudio/account/extension",
|
|
id: "/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/microsoft.visualstudio/account/ExampleAccount/project/ExampleProject",
|
|
location: "Central US",
|
|
properties: {},
|
|
tags: {},
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new VisualStudioResourceProviderClient(credential, subscriptionId);
|
|
const result = await client.projects.update(
|
|
resourceGroupName,
|
|
rootResourceName,
|
|
resourceName,
|
|
body,
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
updateAProjectResource().catch(console.error);
|