Files
2026-03-13 10:59:23 +08:00

30 lines
994 B
JavaScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { DurableTaskClient } = require("@azure/arm-durabletask");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update a Scheduler
*
* @summary create or update a Scheduler
* x-ms-original-file: 2026-02-01/Schedulers_CreateOrUpdate.json
*/
async function schedulersCreateOrUpdate() {
const credential = new DefaultAzureCredential();
const subscriptionId = "EE9BD735-67CE-4A90-89C4-439D3F6A4C93";
const client = new DurableTaskClient(credential, subscriptionId);
const result = await client.schedulers.createOrUpdate("rgopenapi", "testscheduler", {
location: "northcentralus",
properties: { ipAllowlist: ["10.0.0.0/8"], sku: { name: "Dedicated" } },
tags: { department: "research", development: "true" },
});
console.log(result);
}
async function main() {
await schedulersCreateOrUpdate();
}
main().catch(console.error);