managed_server_security_alert_policies
Creates, updates, deletes, gets or lists a managed_server_security_alert_policies resource.
Overview
| Name | managed_server_security_alert_policies |
| Type | Resource |
| Id | azure.sql.managed_server_security_alert_policies |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_instance
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
creationTime | string (date-time) | Specifies the UTC creation time of the policy. |
disabledAlerts | array | Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force. |
emailAccountAdmins | boolean | Specifies that the alert is sent to the account administrators. |
emailAddresses | array | Specifies an array of e-mail addresses to which the alert is sent. |
retentionDays | integer | Specifies the number of days to keep in the Threat Detection audit logs. |
state | string | Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database. Required. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
storageAccountAccessKey | string | Specifies the identifier key of the Threat Detection audit storage account. |
storageEndpoint | string | Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net _). This blob storage will hold all Threat Detection audit logs. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
creationTime | string (date-time) | Specifies the UTC creation time of the policy. |
disabledAlerts | array | Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force. |
emailAccountAdmins | boolean | Specifies that the alert is sent to the account administrators. |
emailAddresses | array | Specifies an array of e-mail addresses to which the alert is sent. |
retentionDays | integer | Specifies the number of days to keep in the Threat Detection audit logs. |
state | string | Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database. Required. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
storageAccountAccessKey | string | Specifies the identifier key of the Threat Detection audit storage account. |
storageEndpoint | string | Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net _). This blob storage will hold all Threat Detection audit logs. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, managed_instance_name, security_alert_policy_name, subscription_id | Get a managed server's threat detection policy. | |
list_by_instance | select | resource_group_name, managed_instance_name, subscription_id | Get the managed server's threat detection policies. | |
create_or_update | insert | resource_group_name, managed_instance_name, security_alert_policy_name, subscription_id | Creates or updates a threat detection policy. | |
create_or_update | replace | resource_group_name, managed_instance_name, security_alert_policy_name, subscription_id | Creates or updates a threat detection policy. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
managed_instance_name | string | The name of the managed instance. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
security_alert_policy_name | string | The name of the security alert policy. "Default" Required. |
subscription_id | string |
SELECT examples
- get
- list_by_instance
Get a managed server's threat detection policy.
SELECT
id,
name,
creationTime,
disabledAlerts,
emailAccountAdmins,
emailAddresses,
retentionDays,
state,
storageAccountAccessKey,
storageEndpoint,
systemData,
type
FROM azure.sql.managed_server_security_alert_policies
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND managed_instance_name = '{{ managed_instance_name }}' -- required
AND security_alert_policy_name = '{{ security_alert_policy_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Get the managed server's threat detection policies.
SELECT
id,
name,
creationTime,
disabledAlerts,
emailAccountAdmins,
emailAddresses,
retentionDays,
state,
storageAccountAccessKey,
storageEndpoint,
systemData,
type
FROM azure.sql.managed_server_security_alert_policies
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND managed_instance_name = '{{ managed_instance_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates or updates a threat detection policy.
INSERT INTO azure.sql.managed_server_security_alert_policies (
properties,
resource_group_name,
managed_instance_name,
security_alert_policy_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ managed_instance_name }}',
'{{ security_alert_policy_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: managed_server_security_alert_policies
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the managed_server_security_alert_policies resource.
- name: managed_instance_name
value: "{{ managed_instance_name }}"
description: Required parameter for the managed_server_security_alert_policies resource.
- name: security_alert_policy_name
value: "{{ security_alert_policy_name }}"
description: Required parameter for the managed_server_security_alert_policies resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the managed_server_security_alert_policies resource.
- name: properties
description: |
Resource properties.
value:
state: "{{ state }}"
disabledAlerts:
- "{{ disabledAlerts }}"
emailAddresses:
- "{{ emailAddresses }}"
emailAccountAdmins: {{ emailAccountAdmins }}
storageEndpoint: "{{ storageEndpoint }}"
storageAccountAccessKey: "{{ storageAccountAccessKey }}"
retentionDays: {{ retentionDays }}
creationTime: "{{ creationTime }}"
REPLACE examples
- create_or_update
Creates or updates a threat detection policy.
REPLACE azure.sql.managed_server_security_alert_policies
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND managed_instance_name = '{{ managed_instance_name }}' --required
AND security_alert_policy_name = '{{ security_alert_policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;