Server Table Auditing Policies - Create Or Update

Creates or updates a server's table auditing policy. Table auditing is deprecated, use blob auditing instead.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingPolicies/default?api-version=2014-04-01

URI Parameters

Name In Required Type Description
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.

tableAuditingPolicyName
path True

TableAuditingPolicyName

The name of the table auditing policy.

api-version
query True

string

The API version to use for the request.

Request Body

Name Type Description
properties.auditLogsTableName

string

The audit logs table name.

properties.auditingState

string

The state of the policy.

properties.eventTypesToAudit

string

Comma-separated list of event types to audit.

properties.fullAuditLogsTableName

string

The full audit logs table name.

properties.retentionDays

string

The number of days to keep in the audit logs.

properties.storageAccountKey

string

The key of the auditing storage account.

properties.storageAccountName

string

The table storage account name

properties.storageAccountResourceGroupName

string

The table storage account resource group name

properties.storageAccountSecondaryKey

string

The secondary key of the auditing storage account.

properties.storageAccountSubscriptionId

string

The table storage subscription Id.

properties.storageTableEndpoint

string

The storage table endpoint.

Responses

Name Type Description
200 OK

ServerTableAuditingPolicy

Successfully set the server table auditing policy.

201 Created

ServerTableAuditingPolicy

Successfully created the server table auditing policy.

Examples

Create or update server table auditing policy

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/auditingPolicies/default?api-version=2014-04-01

Sample response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/databases/testdb/auditingPolicies/Default",
  "name": "Default",
  "type": "Microsoft.Sql/servers/databases/auditingPolicies",
  "location": "West US",
  "kind": null,
  "properties": {
    "auditingState": "New",
    "eventTypesToAudit": "PlainSQL_Success,PlainSQL_Failure,ParameterizedSQL_Success,ParameterizedSQL_Failure,StoredProcedure_Success,StoredProcedure_Failure,Login_Success,Login_Failure,TransactionManagement_Success,TransactionManagement_Failure",
    "storageAccountName": null,
    "storageAccountKey": null,
    "storageAccountSecondaryKey": null,
    "storageTableEndpoint": null,
    "storageAccountResourceGroupName": null,
    "storageAccountSubscriptionId": null,
    "fullAuditLogsTableName": "SQLDBAuditLogsBlobauditingtest2080",
    "auditLogsTableName": "Blobauditingtest2080",
    "retentionDays": "0"
  }
}

Definitions

Name Description
ServerTableAuditingPolicy

A server table auditing policy.

TableAuditingPolicyName

The name of the table auditing policy.

ServerTableAuditingPolicy

A server table auditing policy.

Name Type Description
id

string

Resource ID.

kind

string

Resource kind.

location

string

Resource location.

name

string

Resource name.

properties.auditLogsTableName

string

The audit logs table name.

properties.auditingState

string

The state of the policy.

properties.eventTypesToAudit

string

Comma-separated list of event types to audit.

properties.fullAuditLogsTableName

string

The full audit logs table name.

properties.retentionDays

string

The number of days to keep in the audit logs.

properties.storageAccountKey

string

The key of the auditing storage account.

properties.storageAccountName

string

The table storage account name

properties.storageAccountResourceGroupName

string

The table storage account resource group name

properties.storageAccountSecondaryKey

string

The secondary key of the auditing storage account.

properties.storageAccountSubscriptionId

string

The table storage subscription Id.

properties.storageTableEndpoint

string

The storage table endpoint.

type

string

Resource type.

TableAuditingPolicyName

The name of the table auditing policy.

Name Type Description
default

string