Skip to main content

managed_database_advanced_threat_protection_settings

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

Overview

Namemanaged_database_advanced_threat_protection_settings
TypeResource
Idazure.sql.managed_database_advanced_threat_protection_settings

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
creationTimestring (date-time)Specifies the UTC creation time of the policy.
statestringSpecifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been applied yet on the specific database or server. Required. Known values are: "New", "Enabled", and "Disabled". (New, Enabled, Disabled)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, managed_instance_name, database_name, advanced_threat_protection_name, subscription_idGets a managed database's Advanced Threat Protection state.
list_by_databaseselectresource_group_name, managed_instance_name, database_name, subscription_idGets a list of managed database's Advanced Threat Protection states.
create_or_updateinsertresource_group_name, managed_instance_name, database_name, advanced_threat_protection_name, subscription_idCreates or updates a managed database's Advanced Threat Protection state.
create_or_updatereplaceresource_group_name, managed_instance_name, database_name, advanced_threat_protection_name, subscription_idCreates or updates a managed database's Advanced Threat Protection state.

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.

NameDatatypeDescription
advanced_threat_protection_namestringThe name of the Advanced Threat Protection state. "Default" Required.
database_namestringThe name of the database. Required.
managed_instance_namestringThe name of the managed instance. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Gets a managed database's Advanced Threat Protection state.

SELECT
id,
name,
creationTime,
state,
systemData,
type
FROM azure.sql.managed_database_advanced_threat_protection_settings
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND managed_instance_name = '{{ managed_instance_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND advanced_threat_protection_name = '{{ advanced_threat_protection_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or updates a managed database's Advanced Threat Protection state.

INSERT INTO azure.sql.managed_database_advanced_threat_protection_settings (
properties,
resource_group_name,
managed_instance_name,
database_name,
advanced_threat_protection_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ managed_instance_name }}',
'{{ database_name }}',
'{{ advanced_threat_protection_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

REPLACE examples

Creates or updates a managed database's Advanced Threat Protection state.

REPLACE azure.sql.managed_database_advanced_threat_protection_settings
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND managed_instance_name = '{{ managed_instance_name }}' --required
AND database_name = '{{ database_name }}' --required
AND advanced_threat_protection_name = '{{ advanced_threat_protection_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;