Skip to main content

database_vulnerability_assessments

Creates, updates, deletes, gets or lists a database_vulnerability_assessments resource.

Overview

Namedatabase_vulnerability_assessments
TypeResource
Idazure.sql.database_vulnerability_assessments

Fields

NameDatatypeDescription
databaseNametextfield from the properties object
recurring_scanstextfield from the properties object
resourceGroupNametextfield from the properties object
serverNametextfield from the properties object
storage_account_access_keytextfield from the properties object
storage_container_pathtextfield from the properties object
storage_container_sas_keytextfield from the properties object
subscriptionIdtextfield from the properties object
vulnerabilityAssessmentNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatabaseName, resourceGroupName, serverName, subscriptionId, vulnerabilityAssessmentNameGets the database's vulnerability assessment.
list_by_databaseSELECTdatabaseName, resourceGroupName, serverName, subscriptionIdLists the vulnerability assessment policies associated with a database.
create_or_updateINSERTdatabaseName, resourceGroupName, serverName, subscriptionId, vulnerabilityAssessmentNameCreates or updates the database's vulnerability assessment.
deleteDELETEdatabaseName, resourceGroupName, serverName, subscriptionId, vulnerabilityAssessmentNameRemoves the database's vulnerability assessment.

SELECT examples

Lists the vulnerability assessment policies associated with a database.

SELECT
databaseName,
recurring_scans,
resourceGroupName,
serverName,
storage_account_access_key,
storage_container_path,
storage_container_sas_key,
subscriptionId,
vulnerabilityAssessmentName
FROM azure.sql.vw_database_vulnerability_assessments
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new database_vulnerability_assessments resource.

/*+ create */
INSERT INTO azure.sql.database_vulnerability_assessments (
databaseName,
resourceGroupName,
serverName,
subscriptionId,
vulnerabilityAssessmentName,
properties
)
SELECT
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ vulnerabilityAssessmentName }}',
'{{ properties }}'
;

DELETE example

Deletes the specified database_vulnerability_assessments resource.

/*+ delete */
DELETE FROM azure.sql.database_vulnerability_assessments
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND vulnerabilityAssessmentName = '{{ vulnerabilityAssessmentName }}';