UNPKG

@azure/arm-security

Version:
34 lines 1.85 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 a custom entity store assignment for the provided subscription, if not already exists. * * @summary Creates a custom entity store assignment for the provided subscription, if not already exists. * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentCreate_example.json */ function createACustomEntityStoreAssignment() { return __awaiter(this, void 0, void 0, function* () { const subscriptionId = "e5d1b86c-3051-44d5-8802-aa65d45a279b"; const resourceGroupName = "TestResourceGroup"; const customEntityStoreAssignmentName = "33e7cc6e-a139-4723-a0e5-76993aee0771"; const customEntityStoreAssignmentRequestBody = { principal: "aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47" }; const credential = new DefaultAzureCredential(); const client = new SecurityCenter(credential, subscriptionId); const result = yield client.customEntityStoreAssignments.create(resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody); console.log(result); }); } createACustomEntityStoreAssignment().catch(console.error); //# sourceMappingURL=customEntityStoreAssignmentsCreateSample.js.map