Executes a Vulnerability Assessment database scan.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/default/scans/{scanId}/initiateScan?api-version=2021-11-01
URI Parameters
Name
In
Required
Type
Description
databaseName
path
True
string
The name of the database.
resourceGroupName
path
True
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
scanId
path
True
string
The vulnerability assessment scan Id of the scan to retrieve.
serverName
path
True
string
The name of the server.
subscriptionId
path
True
string
The subscription ID that identifies an Azure subscription.
Successfully executed a Vulnerability Assessment database scan.
202 Accepted
Successfully started a Vulnerability Assessment database scan.
Other Status Codes
*** Error Responses: ***
400 InvalidVulnerabilityAssessmentOperationRequest - The vulnerability assessment operation request does not exist or has no properties object.
400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.
400 InvalidVulnerabilityAssessmentScanIdLength - The vulnerability assessment scan ID length must be below {0} characters.
400 InvalidStorageAccountName - The provided storage account is not valid or does not exist.
400 InvalidStorageAccountCredentials - The provided storage account shared access signature or account storage key is not valid.
400 VulnerabilityAssessmentInvalidPolicy - Vulnerability Assessment settings don't exist or invalid storage specified in settings.
400 VulnerabilityAssessmentADSIsDisabled - Advanced Data Security should be enabled in order to use Vulnerability Assessment.
400 DatabaseVulnerabilityAssessmentMissingStorageContainerPath - Storage container path must be provided if it isn't set in server level policy
400 VulnerabilityAssessmentDatawarehouseDatabaseIsDeactivated - Could not execute Vulnerability Assessment operation because the database is paused. Please resume it.
400 VulnerabilityAssessmentStorageOutboundFirewallNotAllowed - The storage account is not in the list of Outbound Firewall Rules.
404 SubscriptionDoesNotHaveServer - The requested server was not found
404 SourceDatabaseNotFound - The source database does not exist.
404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.
404 OperationIdNotFound - The operation with Id does not exist.
409 DatabaseVulnerabilityAssessmentScanIsAlreadyInProgress - Vulnerability Assessment scan is already in progress.
409 OperationCancelled - The operation has been cancelled by user.
409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.
429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.
429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.
500 DatabaseIsUnavailable - Loading failed. Please try again later.
500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.
503 TooManyRequests - Requests beyond max requests that can be processed by available resources.
Examples
Executes a database's vulnerability assessment scan.
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/databases/testdb/vulnerabilityAssessments/default/scans/scan01/initiateScan?api-version=2021-11-01
import com.azure.resourcemanager.sql.models.VulnerabilityAssessmentName;
/**
* Samples for DatabaseVulnerabilityAssessmentScans InitiateScan.
*/
public final class Main {
/*
* x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/examples/
* DatabaseVulnerabilityAssessmentScansExecute.json
*/
/**
* Sample code: Executes a database's vulnerability assessment scan.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
executesADatabaseSVulnerabilityAssessmentScan(com.azure.resourcemanager.AzureResourceManager azure) {
azure.sqlServers().manager().serviceClient().getDatabaseVulnerabilityAssessmentScans().initiateScan(
"vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb",
VulnerabilityAssessmentName.DEFAULT, "scan01", com.azure.core.util.Context.NONE);
}
}