Skip to main content

database_security_alert_policies

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

Overview

Namedatabase_security_alert_policies
TypeResource
Idazure.sql.database_security_alert_policies

Fields

NameDatatypeDescription
creation_timetextfield from the properties object
databaseNametextfield from the properties object
disabled_alertstextfield from the properties object
email_account_adminstextfield from the properties object
email_addressestextfield from the properties object
resourceGroupNametextfield from the properties object
retention_daystextfield from the properties object
securityAlertPolicyNametextfield from the properties object
serverNametextfield from the properties object
statetextfield from the properties object
storage_account_access_keytextfield from the properties object
storage_endpointtextfield from the properties object
subscriptionIdtextfield from the properties object
system_datatextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatabaseName, resourceGroupName, securityAlertPolicyName, serverName, subscriptionIdGets a database's security alert policy.
list_by_databaseSELECTdatabaseName, resourceGroupName, serverName, subscriptionIdGets a list of database's security alert policies.
create_or_updateINSERTdatabaseName, resourceGroupName, securityAlertPolicyName, serverName, subscriptionIdCreates or updates a database's security alert policy.

SELECT examples

Gets a list of database's 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 }}';

INSERT example

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

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