@azure/arm-security
Version:
A generated SDK for SecurityCenter.
32 lines • 1.66 kB
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 { SecurityCenter } from "@azure/arm-security";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get a security sub-assessment on your scanned resource
*
* @summary Get a security sub-assessment on your scanned resource
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/GetSubAssessment_example.json
*/
function getSecurityRecommendationTaskFromSecurityDataLocation() {
return __awaiter(this, void 0, void 0, function* () {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const scope = "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2";
const assessmentName = "1195afff-c881-495e-9bc5-1486211ae03f";
const subAssessmentName = "95f7da9c-a2a4-1322-0758-fcd24ef09b85";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential, subscriptionId);
const result = yield client.subAssessments.get(scope, assessmentName, subAssessmentName);
console.log(result);
});
}
getSecurityRecommendationTaskFromSecurityDataLocation().catch(console.error);
//# sourceMappingURL=subAssessmentsGetSample.js.map