Skip to main content

server_vulnerability_assessments

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

Overview

Nameserver_vulnerability_assessments
TypeResource
Idazure.sql.server_vulnerability_assessments

Fields

NameDatatypeDescription
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
getSELECTresourceGroupName, serverName, subscriptionId, vulnerabilityAssessmentNameGets the server's vulnerability assessment.
list_by_serverSELECTresourceGroupName, serverName, subscriptionIdLists the vulnerability assessment policies associated with a server.
create_or_updateINSERTresourceGroupName, serverName, subscriptionId, vulnerabilityAssessmentNameCreates or updates the server's vulnerability assessment. Learn more about setting SQL vulnerability assessment with managed identity - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage
deleteDELETEresourceGroupName, serverName, subscriptionId, vulnerabilityAssessmentNameRemoves the server's vulnerability assessment.

SELECT examples

Lists the vulnerability assessment policies associated with a server.

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

INSERT example

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

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

DELETE example

Deletes the specified server_vulnerability_assessments resource.

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