Files

38 lines
1.4 KiB
TypeScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* This sample demonstrates how to Patch dedicated cloud service's properties
*
* @summary Patch dedicated cloud service's properties
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedService.json
*/
import type { PatchPayload } from "@azure/arm-vmwarecloudsimple";
import { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
import "dotenv/config";
async function patchDedicatedService(): Promise<void> {
const subscriptionId = process.env["VMWARECLOUDSIMPLE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["VMWARECLOUDSIMPLE_RESOURCE_GROUP"] || "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const dedicatedCloudServiceRequest: PatchPayload = {
tags: { myTag: "tagValue" },
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.update(
resourceGroupName,
dedicatedCloudServiceName,
dedicatedCloudServiceRequest,
);
console.log(result);
}
async function main(): Promise<void> {
await patchDedicatedService();
}
main().catch(console.error);