36 lines
No EOL
1.5 KiB
JavaScript
36 lines
No EOL
1.5 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.
|
|
*/
|
|
import { __awaiter } from "tslib";
|
|
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
import { SubscriptionClient } from "@azure/arm-subscriptions";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
/**
|
|
* This sample demonstrates how to Create or Update Subscription tenant policy for user's tenant.
|
|
*
|
|
* @summary Create or Update Subscription tenant policy for user's tenant.
|
|
* x-ms-original-file: specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/changeTenantPolicy.json
|
|
*/
|
|
function tenantPolicy() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const body = {
|
|
blockSubscriptionsIntoTenant: true,
|
|
blockSubscriptionsLeavingTenant: true,
|
|
exemptedPrincipals: [
|
|
"e879cf0f-2b4d-5431-109a-f72fc9868693",
|
|
"9792da87-c97b-410d-a97d-27021ba09ce6"
|
|
]
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new SubscriptionClient(credential);
|
|
const result = yield client.subscriptionPolicy.addUpdatePolicyForTenant(body);
|
|
console.log(result);
|
|
});
|
|
}
|
|
tenantPolicy().catch(console.error);
|
|
//# sourceMappingURL=subscriptionPolicyAddUpdatePolicyForTenantSample.js.map
|