UNPKG

@azure/arm-security

Version:
33 lines 2.05 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 Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it * * @summary Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json */ function createAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceCreatingTheResourceTheServerWillBeOnboardedToVulnerabilityAssessmentByMicrosoftSecurity() { return __awaiter(this, void 0, void 0, function* () { const subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; const resourceGroupName = "rg1"; const resourceNamespace = "Microsoft.Compute"; const resourceType = "virtualMachines"; const resourceName = "vm1"; const credential = new DefaultAzureCredential(); const client = new SecurityCenter(credential, subscriptionId); const result = yield client.serverVulnerabilityAssessmentOperations.createOrUpdate(resourceGroupName, resourceNamespace, resourceType, resourceName); console.log(result); }); } createAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceCreatingTheResourceTheServerWillBeOnboardedToVulnerabilityAssessmentByMicrosoftSecurity().catch(console.error); //# sourceMappingURL=serverVulnerabilityAssessmentCreateOrUpdateSample.js.map