/* * 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 { StorageManagementClient } from "@azure/arm-storage"; import { DefaultAzureCredential } from "@azure/identity"; /** * This sample demonstrates how to Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different properties, the encryption scope properties will be updated per the specified request. * * @summary Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different properties, the encryption scope properties will be updated per the specified request. * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountPutEncryptionScope.json */ function storageAccountPutEncryptionScope() { return __awaiter(this, void 0, void 0, function* () { const subscriptionId = "{subscription-id}"; const resourceGroupName = "resource-group-name"; const accountName = "{storage-account-name}"; const encryptionScopeName = "{encryption-scope-name}"; const encryptionScope = {}; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const result = yield client.encryptionScopes.put(resourceGroupName, accountName, encryptionScopeName, encryptionScope); console.log(result); }); } storageAccountPutEncryptionScope().catch(console.error); /** * This sample demonstrates how to Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different properties, the encryption scope properties will be updated per the specified request. * * @summary Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different properties, the encryption scope properties will be updated per the specified request. * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountPutEncryptionScopeWithInfrastructureEncryption.json */ function storageAccountPutEncryptionScopeWithInfrastructureEncryption() { return __awaiter(this, void 0, void 0, function* () { const subscriptionId = "{subscription-id}"; const resourceGroupName = "resource-group-name"; const accountName = "{storage-account-name}"; const encryptionScopeName = "{encryption-scope-name}"; const encryptionScope = { requireInfrastructureEncryption: true }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const result = yield client.encryptionScopes.put(resourceGroupName, accountName, encryptionScopeName, encryptionScope); console.log(result); }); } storageAccountPutEncryptionScopeWithInfrastructureEncryption().catch(console.error); //# sourceMappingURL=encryptionScopesPutSample.js.map