Files
colawwjandGitHub df9f6dc804 Refresh 7 (#21441)
* datacatalog

* datadog

* datalake-analytics

* datamigration

* depolymentmanager

* desktopvirtualization

* deviceprovisioningservices

* devtestlabs

* update

* update

* update

* refresh-7

* update

* update

* update

* update

* update
2022-04-19 17:05:19 +08:00

71 lines
2.3 KiB
JavaScript

/*
* 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.
const { DevTestLabsClient } = require("@azure/arm-devtestlabs");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or replace an existing formula. This operation can take a while to complete.
*
* @summary Create or replace an existing formula. This operation can take a while to complete.
* x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_CreateOrUpdate.json
*/
async function formulasCreateOrUpdate() {
const subscriptionId = "{subscriptionId}";
const resourceGroupName = "resourceGroupName";
const labName = "{labName}";
const name = "{formulaName}";
const formula = {
description: "Formula using a Linux base",
formulaContent: {
allowClaim: false,
artifacts: [
{
artifactId: "/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs",
parameters: [],
},
],
disallowPublicIpAddress: true,
galleryImageReference: {
offer: "0001-com-ubuntu-server-groovy",
osType: "Linux",
publisher: "canonical",
sku: "20_10",
version: "latest",
},
isAuthenticationWithSshKey: false,
labSubnetName: "Dtl{labName}Subnet",
labVirtualNetworkId: "/virtualnetworks/dtl{labName}",
location: "{location}",
networkInterface: {
sharedPublicIpAddressConfiguration: {
inboundNatRules: [{ backendPort: 22, transportProtocol: "Tcp" }],
},
},
notes: "Ubuntu Server 20.10",
size: "Standard_B1ms",
storageType: "Standard",
userName: "user",
},
location: "{location}",
};
const credential = new DefaultAzureCredential();
const client = new DevTestLabsClient(credential, subscriptionId);
const result = await client.formulas.beginCreateOrUpdateAndWait(
resourceGroupName,
labName,
name,
formula
);
console.log(result);
}
formulasCreateOrUpdate().catch(console.error);