database_vulnerability_assessments
Creates, updates, deletes, gets or lists a database_vulnerability_assessments
resource.
Overview
Name | database_vulnerability_assessments |
Type | Resource |
Id | azure.sql.database_vulnerability_assessments |
Fields
- vw_database_vulnerability_assessments
- database_vulnerability_assessments
Name | Datatype | Description |
---|---|---|
databaseName | text | field from the properties object |
recurring_scans | text | field from the properties object |
resourceGroupName | text | field from the properties object |
serverName | text | field from the properties object |
storage_account_access_key | text | field from the properties object |
storage_container_path | text | field from the properties object |
storage_container_sas_key | text | field from the properties object |
subscriptionId | text | field from the properties object |
vulnerabilityAssessmentName | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | Properties of a database Vulnerability Assessment. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, resourceGroupName, serverName, subscriptionId, vulnerabilityAssessmentName | Gets the database's vulnerability assessment. |
list_by_database | SELECT | databaseName, resourceGroupName, serverName, subscriptionId | Lists the vulnerability assessment policies associated with a database. |
create_or_update | INSERT | databaseName, resourceGroupName, serverName, subscriptionId, vulnerabilityAssessmentName | Creates or updates the database's vulnerability assessment. |
delete | DELETE | databaseName, resourceGroupName, serverName, subscriptionId, vulnerabilityAssessmentName | Removes the database's vulnerability assessment. |
SELECT
examples
Lists the vulnerability assessment policies associated with a database.
- vw_database_vulnerability_assessments
- database_vulnerability_assessments
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 }}';
SELECT
properties
FROM azure.sql.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.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.database_vulnerability_assessments (
databaseName,
resourceGroupName,
serverName,
subscriptionId,
vulnerabilityAssessmentName,
properties
)
SELECT
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ vulnerabilityAssessmentName }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: storageContainerPath
value: string
- name: storageContainerSasKey
value: string
- name: storageAccountAccessKey
value: string
- name: recurringScans
value:
- name: isEnabled
value: boolean
- name: emailSubscriptionAdmins
value: boolean
- name: emails
value:
- string
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 }}';