database_security_alert_policies
Creates, updates, deletes, gets or lists a database_security_alert_policies
resource.
Overview
Name | database_security_alert_policies |
Type | Resource |
Id | azure.sql.database_security_alert_policies |
Fields
- vw_database_security_alert_policies
- database_security_alert_policies
Name | Datatype | Description |
---|---|---|
creation_time | text | field from the properties object |
databaseName | text | field from the properties object |
disabled_alerts | text | field from the properties object |
email_account_admins | text | field from the properties object |
email_addresses | text | field from the properties object |
resourceGroupName | text | field from the properties object |
retention_days | text | field from the properties object |
securityAlertPolicyName | text | field from the properties object |
serverName | text | field from the properties object |
state | text | field from the properties object |
storage_account_access_key | text | field from the properties object |
storage_endpoint | text | field from the properties object |
subscriptionId | text | field from the properties object |
system_data | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | Properties of a security alert policy. |
systemData | object | Metadata pertaining to creation and last modification of the resource. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, resourceGroupName, securityAlertPolicyName, serverName, subscriptionId | Gets a database's security alert policy. |
list_by_database | SELECT | databaseName, resourceGroupName, serverName, subscriptionId | Gets a list of database's security alert policies. |
create_or_update | INSERT | databaseName, resourceGroupName, securityAlertPolicyName, serverName, subscriptionId | Creates or updates a database's security alert policy. |
SELECT
examples
Gets a list of database's security alert policies.
- vw_database_security_alert_policies
- database_security_alert_policies
SELECT
creation_time,
databaseName,
disabled_alerts,
email_account_admins,
email_addresses,
resourceGroupName,
retention_days,
securityAlertPolicyName,
serverName,
state,
storage_account_access_key,
storage_endpoint,
subscriptionId,
system_data
FROM azure.sql.vw_database_security_alert_policies
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties,
systemData
FROM azure.sql.database_security_alert_policies
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_security_alert_policies
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.database_security_alert_policies (
databaseName,
resourceGroupName,
securityAlertPolicyName,
serverName,
subscriptionId,
properties
)
SELECT
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ securityAlertPolicyName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: systemData
value:
- name: createdBy
value: string
- name: createdByType
value: string
- name: createdAt
value: string
- name: lastModifiedBy
value: string
- name: lastModifiedByType
value: string
- name: lastModifiedAt
value: string
- name: properties
value:
- name: state
value: string
- name: disabledAlerts
value:
- string
- name: emailAddresses
value:
- string
- name: emailAccountAdmins
value: boolean
- name: storageEndpoint
value: string
- name: storageAccountAccessKey
value: string
- name: retentionDays
value: integer
- name: creationTime
value: string