Server Advanced Threat Protection Settings - Create Or Update

Creates or updates an Advanced Threat Protection state.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/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.

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

ServerAdvancedThreatProtection

Successfully created or updated the Advanced Threat Protection state.

202 Accepted

Created request to set the Advanced Threat Protection state.

Other Status Codes

*** Error Responses: ***

  • 400 UpdateNotAllowedOnServerContainingPausedDWDatabase - Setting the server Advanced Threat Protection settings is not allowed on a server with a paused Data Warehouse database

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

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

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

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

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

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

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

  • 404 OperationIdNotFound - The operation with Id does not exist.

  • 409 ServerAdvancedThreatProtectionInProgress - Setting the server Advanced Threat Protection settings is already in progress

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

  • 409 OperationCancelled - The operation has been cancelled by user.

  • 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

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

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

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

  • 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

Examples

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

Update a server'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/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/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 server'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/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/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.

ServerAdvancedThreatProtection

A server 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

ServerAdvancedThreatProtection

A server 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.