UNPKG

@azure/arm-security

Version:
36 lines 2.11 kB
/* * 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 { SecurityCenter } from "@azure/arm-security"; import { DefaultAzureCredential } from "@azure/identity"; /** * This sample demonstrates how to Creates or updates the Advanced Threat Protection settings on a specified resource. * * @summary Creates or updates the Advanced Threat Protection settings on a specified resource. * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json */ function createsOrUpdatesTheAdvancedThreatProtectionSettingsOnASpecifiedResource() { return __awaiter(this, void 0, void 0, function* () { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const resourceId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount"; const advancedThreatProtectionSetting = { name: "current", type: "Microsoft.Security/advancedThreatProtectionSettings", id: "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current", isEnabled: true }; const credential = new DefaultAzureCredential(); const client = new SecurityCenter(credential, subscriptionId); const result = yield client.advancedThreatProtection.create(resourceId, advancedThreatProtectionSetting); console.log(result); }); } createsOrUpdatesTheAdvancedThreatProtectionSettingsOnASpecifiedResource().catch(console.error); //# sourceMappingURL=advancedThreatProtectionCreateSample.js.map