Files
azure-sdk-for-js/sdk/sql/arm-sql/samples-dev/managedDatabaseVulnerabilityAssessmentScansExportSample.ts

32 lines
1.1 KiB
TypeScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { SqlManagementClient } from "@azure/arm-sql";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to convert an existing scan result to a human readable format. If already exists nothing happens
*
* @summary convert an existing scan result to a human readable format. If already exists nothing happens
* x-ms-original-file: 2025-01-01/ManagedDatabaseVulnerabilityAssessmentScanExport.json
*/
async function exportADatabaseVulnerabilityAssessmentScanResults(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.managedDatabaseVulnerabilityAssessmentScans.export(
"vulnerabilityassessmenttest-4799",
"vulnerabilityassessmenttest-6440",
"testdb",
"default",
"scan001",
);
console.log(result);
}
async function main(): Promise<void> {
await exportADatabaseVulnerabilityAssessmentScanResults();
}
main().catch(console.error);