botbook/node_modules/@azure/arm-resources/dist-esm/samples-dev/deploymentsWhatIfSample.js

42 lines
1.9 KiB
JavaScript
Raw Normal View History

2024-09-04 13:13:15 -03:00
/*
* 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.
*/
import { __awaiter } from "tslib";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceManagementClient } from "@azure/arm-resources";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the resource group.
*
* @summary Returns changes that will be made by the deployment if executed at the scope of the resource group.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json
*/
function predictTemplateChangesAtResourceGroupScope() {
return __awaiter(this, void 0, void 0, function* () {
const subscriptionId = process.env["RESOURCES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000001";
const resourceGroupName = process.env["RESOURCES_RESOURCE_GROUP"] || "my-resource-group";
const deploymentName = "my-deployment";
const parameters = {
properties: { mode: "Incremental", parameters: {}, templateLink: {} }
};
const credential = new DefaultAzureCredential();
const client = new ResourceManagementClient(credential, subscriptionId);
const result = yield client.deployments.beginWhatIfAndWait(resourceGroupName, deploymentName, parameters);
console.log(result);
});
}
function main() {
return __awaiter(this, void 0, void 0, function* () {
predictTemplateChangesAtResourceGroupScope();
});
}
main().catch(console.error);
//# sourceMappingURL=deploymentsWhatIfSample.js.map