Database Advanced Threat Protection Settings - Create Or Update

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

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/Default?api-version=2021-11-01

URI Parameters

Name In Required Type Description
advancedThreatProtectionName
path True

AdvancedThreatProtectionName

The name of the Advanced Threat Protection state.

databaseName
path True

string

The name of the database.

resourceGroupName
path True

string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

serverName
path True

string

The name of the server.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Request Body

Name Required Type Description
properties.state True

AdvancedThreatProtectionState

Specifies 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.

Responses

Name Type Description
200 OK

DatabaseAdvancedThreatProtection

Successfully set the database Advanced Threat Protection state.

201 Created

DatabaseAdvancedThreatProtection

Successfully created the database Advanced Threat Protection state.

Other Status Codes

*** Error Responses: ***

  • 400 UpdateNotAllowedOnPausedDatabase - User attempted to perform an update on a paused database.

  • 400 AdvancedThreatProtectionInsufficientDiskSpace - Insufficient disk space to save the Advanced Threat Protection settings metadata in the database

  • 400 InvalidDatabaseAdvancedThreatProtectionCreateRequest - The create database Advanced Threat Protection request does not exist or has no properties object

  • 400 AdvancedThreatProtectionInvalidUserSuppliedParameter - An invalid parameter value was provided by the client

  • 400 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later

  • 400 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

  • 404 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later

  • 409 DatabaseAdvancedThreatProtectionInProgress - Setting the database Advanced Threat Protection is already in progress

  • 409 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later

  • 500 DatabaseIsUnavailable - Loading failed. Please try again later.

  • 500 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later

  • 500 GetDatabaseAdvancedThreatProtectionFailed - Failed to get Advanced Threat Protection settings

Examples

Update a database's Advanced Threat Protection settings with all parameters
Update a database's Advanced Threat Protection settings with minimal parameters

Update a database's Advanced Threat Protection settings with all parameters

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/databases/testdb/advancedThreatProtectionSettings/Default?api-version=2021-11-01

{
  "properties": {
    "state": "Enabled"
  }
}

Sample Response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default",
  "name": "Default",
  "type": "Microsoft.Sql/servers/databases/advancedThreatProtectionSettings",
  "systemData": {
    "createdBy": "string",
    "createdByType": "User",
    "createdAt": "2022-04-03T04:41:33.937Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2022-04-03T04:41:33.937Z"
  },
  "properties": {
    "state": "Enabled",
    "creationTime": "2022-04-03T04:41:33.937Z"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default",
  "name": "Default",
  "type": "Microsoft.Sql/servers/databases/advancedThreatProtectionSettings",
  "systemData": {
    "createdBy": "string",
    "createdByType": "User",
    "createdAt": "2022-04-03T04:41:33.937Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2022-04-03T04:41:33.937Z"
  },
  "properties": {
    "state": "Enabled",
    "creationTime": "2022-04-03T04:41:33.937Z"
  }
}

Update a database's Advanced Threat Protection settings with minimal parameters

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/databases/testdb/advancedThreatProtectionSettings/Default?api-version=2021-11-01

{
  "properties": {
    "state": "Disabled"
  }
}

Sample Response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default",
  "name": "Default",
  "type": "Microsoft.Sql/servers/databases/advancedThreatProtectionSettings",
  "systemData": {
    "createdBy": "string",
    "createdByType": "User",
    "createdAt": "2022-04-03T04:41:33.937Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2022-04-03T04:41:33.937Z"
  },
  "properties": {
    "state": "Disabled",
    "creationTime": "2022-04-03T04:41:33.937Z"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default",
  "name": "Default",
  "type": "Microsoft.Sql/servers/databases/advancedThreatProtectionSettings",
  "systemData": {
    "createdBy": "string",
    "createdByType": "User",
    "createdAt": "2022-04-03T04:41:33.937Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2022-04-03T04:41:33.937Z"
  },
  "properties": {
    "state": "Disabled",
    "creationTime": "2022-04-03T04:41:33.937Z"
  }
}

Definitions

Name Description
AdvancedThreatProtectionName

The name of the Advanced Threat Protection state.

AdvancedThreatProtectionState

Specifies 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.

createdByType

The type of identity that created the resource.

DatabaseAdvancedThreatProtection

A database Advanced Threat Protection.

systemData

Metadata pertaining to creation and last modification of the resource.

AdvancedThreatProtectionName

The name of the Advanced Threat Protection state.

Name Type Description
Default

string

AdvancedThreatProtectionState

Specifies 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.

Name Type Description
Disabled

string

Enabled

string

New

string

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

DatabaseAdvancedThreatProtection

A database Advanced Threat Protection.

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.creationTime

string

Specifies the UTC creation time of the policy.

properties.state

AdvancedThreatProtectionState

Specifies 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.

systemData

systemData

SystemData of AdvancedThreatProtectionResource.

type

string

Resource type.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.