swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities.
  title: SqlManagementClient
  version: 2017-03-01-preview
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/blobAuditing.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: sql-blobAuditing
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
parameters:
  ApiVersionParameter:
    description: The API version to use for the request.
    in: query
    name: api-version
    required: true
    type: string
    x-ms-parameter-location: client
  BlobAuditingPolicyNameParameter:
    description: The name of the blob auditing policy.
    enum:
      - default
    in: path
    name: blobAuditingPolicyName
    required: true
    type: string
    x-ms-parameter-location: method
  DatabaseNameParameter:
    description: The name of the database.
    in: path
    name: databaseName
    required: true
    type: string
    x-ms-parameter-location: method
  ManagedInstanceNameParameter:
    description: The name of the managed instance.
    in: path
    name: managedInstanceName
    required: true
    type: string
    x-ms-parameter-location: method
  ResourceGroupParameter:
    description: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    in: path
    name: resourceGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  ServerNameParameter:
    description: The name of the server.
    in: path
    name: serverName
    required: true
    type: string
    x-ms-parameter-location: method
  SqlVirtualMachineContainerNameParameter:
    description: The name of the SqlVirtualMachineContainer.
    in: path
    name: sqlVirtualMachineContainerName
    required: true
    type: string
    x-ms-parameter-location: method
  SqlVirtualMachineInstanceNameParameter:
    description: The name of the SqlVirtualMachineInstance.
    in: path
    name: sqlVirtualMachineInstanceName
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: The subscription ID that identifies an Azure subscription.
    in: path
    name: subscriptionId
    required: true
    type: string
    x-ms-parameter-location: client
  VirtualClusterNameParameter:
    description: The name of the virtual cluster.
    in: path
    name: virtualClusterName
    required: true
    type: string
    x-ms-parameter-location: method
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings":
    get:
      description: Lists auditing settings of a server.
      operationId: ServerBlobAuditingPolicies_ListByServer
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved server auditing settings.
          schema:
            $ref: "#/definitions/ServerBlobAuditingPolicyListResult"
        default:
          description: |-
            *** Error Responses: ***

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.
      tags:
        - BlobAuditing
      x-ms-examples:
        List auditing settings of a server:
          parameters:
            api-version: 2017-03-01-preview
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/auditingSettings/default
                    name: default
                    properties:
                      auditActionsAndGroups: []
                      isAzureMonitorTargetEnabled: false
                      isStorageSecondaryKeyInUse: false
                      retentionDays: 0
                      state: Disabled
                      storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                      storageEndpoint: ""
                    type: Microsoft.Sql/servers/auditingSettings
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}":
    get:
      description: Gets a server's blob auditing policy.
      operationId: ServerBlobAuditingPolicies_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/BlobAuditingPolicyNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the server blob auditing policy.
          schema:
            $ref: "#/definitions/ServerBlobAuditingPolicy"
        default:
          description: |-
            *** Error Responses: ***

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.
      tags:
        - BlobAuditing
      x-ms-examples:
        Get a server's blob auditing policy:
          parameters:
            api-version: 2017-03-01-preview
            blobAuditingPolicyName: default
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/auditingSettings/default
                name: default
                properties:
                  auditActionsAndGroups: []
                  isAzureMonitorTargetEnabled: false
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 0
                  state: Disabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                  storageEndpoint: ""
                type: Microsoft.Sql/servers/auditingSettings
    put:
      description: Creates or updates a server's blob auditing policy.
      operationId: ServerBlobAuditingPolicies_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/BlobAuditingPolicyNameParameter"
        - description: Properties of blob auditing policy
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ServerBlobAuditingPolicy"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully updated the auditing settings.
          schema:
            $ref: "#/definitions/ServerBlobAuditingPolicy"
        "202":
          description: Updating the auditing settings is in progress.
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidServerBlobAuditingPolicyCreateRequest - The create server blob auditing policy request does not exist or has no properties object.

             * 400 InvalidBlobAuditActionsAndGroups - Invalid audit actions or action groups.

             * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.

             * 400 InvalidBlobAuditActionsAndGroups - Invalid audit actions or action groups.

             * 400 InvalidBlobAuditActions - Invalid audit action

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

             * 409 ServerBlobAuditingPolicyInProgress - Set server blob auditing is already in progress.
      tags:
        - BlobAuditing
      x-ms-examples:
        Update a server's blob auditing policy with all parameters:
          parameters:
            api-version: 2017-03-01-preview
            blobAuditingPolicyName: default
            parameters:
              properties:
                auditActionsAndGroups:
                  - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                  - FAILED_DATABASE_AUTHENTICATION_GROUP
                  - BATCH_COMPLETED_GROUP
                isAzureMonitorTargetEnabled: true
                isStorageSecondaryKeyInUse: false
                queueDelayMs: 4000
                retentionDays: 6
                state: Enabled
                storageAccountAccessKey: sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==
                storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                storageEndpoint: https://mystorage.blob.core.windows.net
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/auditingSettings/default
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: true
                  isStorageSecondaryKeyInUse: false
                  queueDelayMs: 4000
                  retentionDays: 6
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/auditingSettings
            "202":
              operation: UpsertServerEngineAuditingPolicy
              startTime: 2017-11-22T09:34:54.72Z
        Update a server's blob auditing policy with minimal parameters:
          parameters:
            api-version: 2017-03-01-preview
            blobAuditingPolicyName: default
            parameters:
              properties:
                state: Enabled
                storageAccountAccessKey: sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==
                storageEndpoint: https://mystorage.blob.core.windows.net
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/auditingSettings/default
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 6
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/auditingSettings
            "202":
              operation: UpsertServerEngineAuditingPolicy
              startTime: 2017-11-22T09:34:54.72Z
      x-ms-long-running-operation: true
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings":
    get:
      description: Lists auditing settings of a database.
      operationId: DatabaseBlobAuditingPolicies_ListByDatabase
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/DatabaseNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved database auditing settings.
          schema:
            $ref: "#/definitions/DatabaseBlobAuditingPolicyListResult"
        default:
          description: |-
            *** Error Responses: ***

             * 400 BlobAuditingIsNotSupportedOnResourceType - Blob Auditing is currently not supported for this resource type.

             * 404 SourceDatabaseNotFound - The source database does not exist.

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

             * 500 DatabaseIsUnavailable - Loading failed. Please try again later.
      tags:
        - BlobAuditing
      x-ms-examples:
        List audit settings of a database:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: testdb
            resourceGroupName: blobauditingtest-6852
            serverName: blobauditingtest-2080
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/databases/testdb
                    kind: V12
                    name: default
                    properties:
                      auditActionsAndGroups: []
                      isAzureMonitorTargetEnabled: false
                      isStorageSecondaryKeyInUse: false
                      retentionDays: 0
                      state: Disabled
                      storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                      storageEndpoint: ""
                    type: Microsoft.Sql/servers/databases/auditingSettings
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}":
    get:
      description: Gets a database's blob auditing policy.
      operationId: DatabaseBlobAuditingPolicies_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/DatabaseNameParameter"
        - $ref: "#/parameters/BlobAuditingPolicyNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the database blob auditing policy.
          schema:
            $ref: "#/definitions/DatabaseBlobAuditingPolicy"
        default:
          description: |-
            *** Error Responses: ***

             * 400 BlobAuditingIsNotSupportedOnResourceType - Blob Auditing is currently not supported for this resource type.

             * 404 SourceDatabaseNotFound - The source database does not exist.

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

             * 500 DatabaseIsUnavailable - Loading failed. Please try again later.
      tags:
        - BlobAuditing
      x-ms-examples:
        Get a database's blob auditing policy:
          parameters:
            api-version: 2015-05-01-preview
            blobAuditingPolicyName: default
            databaseName: testdb
            resourceGroupName: blobauditingtest-6852
            serverName: blobauditingtest-2080
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/databases/testdb
                kind: V12
                name: default
                properties:
                  auditActionsAndGroups: []
                  isAzureMonitorTargetEnabled: false
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 0
                  state: Disabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                  storageEndpoint: ""
                type: Microsoft.Sql/servers/databases/auditingSettings
    put:
      description: Creates or updates a database's blob auditing policy.
      operationId: DatabaseBlobAuditingPolicies_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/DatabaseNameParameter"
        - $ref: "#/parameters/BlobAuditingPolicyNameParameter"
        - description: The database blob auditing policy.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/DatabaseBlobAuditingPolicy"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully set the database blob auditing policy.
          schema:
            $ref: "#/definitions/DatabaseBlobAuditingPolicy"
        "201":
          description: Successfully created the database blob auditing policy.
          schema:
            $ref: "#/definitions/DatabaseBlobAuditingPolicy"
        default:
          description: |-
            *** Error Responses: ***

             * 400 BlobAuditingIsNotSupportedOnResourceType - Blob Auditing is currently not supported for this resource type.

             * 400 InvalidDatabaseBlobAuditingPolicyCreateRequest - The create database blob auditing policy request does not exist or has no properties object.

             * 400 InvalidBlobAuditActionsAndGroups - Invalid audit actions or action groups.

             * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.

             * 400 BlobAuditingInvalidStorageAccountName - The provided storage account is not valid or does not exist.

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

             * 400 BlobAuditingInvalidStorageAccountCredentials - The provided storage account or access key is not valid.

             * 400 BlobAuditingIsNotSupportedOnGeoDr - Blob auditing can be configured on primary databases only.

             * 400 InvalidBlobAuditActionsAndGroupsForDW - Unsupported audit actions or action groups for DW.

             * 400 BlobAuditingInsufficientStorageAccountPermissions - Insufficient read or write permissions on the provided storage account.

             * 400 BlobAuditingStorageAccountIsDisabled - The provided storage account is disabled.

             * 400 InvalidBlobAuditActions - Invalid audit action

             * 404 SourceDatabaseNotFound - The source database does not exist.

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

             * 500 DatabaseIsUnavailable - Loading failed. Please try again later.
      tags:
        - BlobAuditing
      x-ms-examples:
        Create or update a database's azure monitor auditing policy with minimal parameters:
          parameters:
            api-version: 2015-05-01-preview
            blobAuditingPolicyName: default
            databaseName: testdb
            parameters:
              properties:
                isAzureMonitorTargetEnabled: true
                state: Enabled
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                kind: V12
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: true
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                type: Microsoft.Sql/servers/databases/auditingSettings
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                kind: V12
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: true
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                type: Microsoft.Sql/servers/databases/auditingSettings
        Create or update a database's blob auditing policy with all parameters:
          parameters:
            api-version: 2015-05-01-preview
            blobAuditingPolicyName: default
            databaseName: testdb
            parameters:
              properties:
                auditActionsAndGroups:
                  - DATABASE_LOGOUT_GROUP
                  - DATABASE_ROLE_MEMBER_CHANGE_GROUP
                  - UPDATE on database::TestDatabaseName by public
                isAzureMonitorTargetEnabled: true
                isStorageSecondaryKeyInUse: false
                queueDelayMs: 4000
                retentionDays: 6
                state: Enabled
                storageAccountAccessKey: sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==
                storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                storageEndpoint: https://mystorage.blob.core.windows.net
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                kind: V12
                name: default
                properties:
                  auditActionsAndGroups:
                    - DATABASE_LOGOUT_GROUP
                    - DATABASE_ROLE_MEMBER_CHANGE_GROUP
                    - UPDATE on database::TestDatabaseName by public
                  isAzureMonitorTargetEnabled: true
                  isStorageSecondaryKeyInUse: false
                  queueDelayMs: 4000
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/databases/auditingSettings
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                kind: V12
                name: default
                properties:
                  auditActionsAndGroups:
                    - DATABASE_LOGOUT_GROUP
                    - DATABASE_ROLE_MEMBER_CHANGE_GROUP
                    - UPDATE on database::TestDatabaseName by public
                  isAzureMonitorTargetEnabled: true
                  isStorageSecondaryKeyInUse: false
                  queueDelayMs: 4000
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/databases/auditingSettings
        Create or update a database's blob auditing policy with minimal parameters:
          parameters:
            api-version: 2015-05-01-preview
            blobAuditingPolicyName: default
            databaseName: testdb
            parameters:
              properties:
                state: Enabled
                storageAccountAccessKey: sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==
                storageEndpoint: https://mystorage.blob.core.windows.net
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                kind: V12
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: false
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/databases/auditingSettings
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                kind: V12
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: false
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/databases/auditingSettings
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}":
    get:
      description: Gets an extended database's blob auditing policy.
      operationId: ExtendedDatabaseBlobAuditingPolicies_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/DatabaseNameParameter"
        - $ref: "#/parameters/BlobAuditingPolicyNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the extended database blob auditing policy.
          schema:
            $ref: "#/definitions/ExtendedDatabaseBlobAuditingPolicy"
        default:
          description: |-
            *** Error Responses: ***

             * 400 BlobAuditingIsNotSupportedOnResourceType - Blob Auditing is currently not supported for this resource type.

             * 404 SourceDatabaseNotFound - The source database does not exist.

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

             * 500 DatabaseIsUnavailable - Loading failed. Please try again later.
      tags:
        - BlobAuditing
      x-ms-examples:
        Get an extended database's blob auditing policy:
          parameters:
            api-version: 2017-03-01-preview
            blobAuditingPolicyName: default
            databaseName: testdb
            resourceGroupName: blobauditingtest-6852
            serverName: blobauditingtest-2080
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/databases/testdb
                name: default
                properties:
                  auditActionsAndGroups: []
                  isAzureMonitorTargetEnabled: false
                  isStorageSecondaryKeyInUse: false
                  predicateExpression: statement = 'select 1'
                  retentionDays: 0
                  state: Disabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                  storageEndpoint: ""
                type: Microsoft.Sql/servers/databases/extendedAuditingSettings
    put:
      description: Creates or updates an extended database's blob auditing policy.
      operationId: ExtendedDatabaseBlobAuditingPolicies_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/DatabaseNameParameter"
        - $ref: "#/parameters/BlobAuditingPolicyNameParameter"
        - description: The extended database blob auditing policy.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ExtendedDatabaseBlobAuditingPolicy"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully set the extended database blob auditing policy.
          schema:
            $ref: "#/definitions/ExtendedDatabaseBlobAuditingPolicy"
        "201":
          description: Successfully created the extended database blob auditing policy.
          schema:
            $ref: "#/definitions/ExtendedDatabaseBlobAuditingPolicy"
        default:
          description: |-
            *** Error Responses: ***

             * 400 BlobAuditingIsNotSupportedOnResourceType - Blob Auditing is currently not supported for this resource type.

             * 400 BlobAuditingPredicateExpressionSyntaxError - Invalid value of parameter 'predicateExpression'.

             * 400 InvalidDatabaseBlobAuditingPolicyCreateRequest - The create database blob auditing policy request does not exist or has no properties object.

             * 400 InvalidBlobAuditActionsAndGroups - Invalid audit actions or action groups.

             * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.

             * 400 BlobAuditingPredicateExpressionEmpty - Invalid parameter 'predicateExpression', value can not be empty.

             * 400 BlobAuditingInvalidStorageAccountName - The provided storage account is not valid or does not exist.

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

             * 400 BlobAuditingInvalidStorageAccountCredentials - The provided storage account or access key is not valid.

             * 400 BlobAuditingIsNotSupportedOnGeoDr - Blob auditing can be configured on primary databases only.

             * 400 InvalidBlobAuditActionsAndGroupsForDW - Unsupported audit actions or action groups for DW.

             * 400 BlobAuditingInsufficientStorageAccountPermissions - Insufficient read or write permissions on the provided storage account.

             * 400 BlobAuditingStorageAccountIsDisabled - The provided storage account is disabled.

             * 400 InvalidBlobAuditActions - Invalid audit action

             * 404 SourceDatabaseNotFound - The source database does not exist.

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

             * 500 DatabaseIsUnavailable - Loading failed. Please try again later.
      tags:
        - BlobAuditing
      x-ms-examples:
        Create or update an extended database's azure monitor auditing policy with minimal parameters:
          parameters:
            api-version: 2017-03-01-preview
            blobAuditingPolicyName: default
            databaseName: testdb
            parameters:
              properties:
                isAzureMonitorTargetEnabled: true
                state: Enabled
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: true
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                type: Microsoft.Sql/servers/databases/extendedAuditingSettings
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: true
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                type: Microsoft.Sql/servers/databases/extendedAuditingSettings
        Create or update an extended database's blob auditing policy with all parameters:
          parameters:
            api-version: 2017-03-01-preview
            blobAuditingPolicyName: default
            databaseName: testdb
            parameters:
              properties:
                auditActionsAndGroups:
                  - DATABASE_LOGOUT_GROUP
                  - DATABASE_ROLE_MEMBER_CHANGE_GROUP
                  - UPDATE on database::TestDatabaseName by public
                isAzureMonitorTargetEnabled: true
                isStorageSecondaryKeyInUse: false
                predicateExpression: statement = 'select 1'
                retentionDays: 6
                state: Enabled
                storageAccountAccessKey: sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==
                storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                storageEndpoint: https://mystorage.blob.core.windows.net
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                name: default
                properties:
                  auditActionsAndGroups:
                    - DATABASE_LOGOUT_GROUP
                    - DATABASE_ROLE_MEMBER_CHANGE_GROUP
                    - UPDATE on database::TestDatabaseName by public
                  isAzureMonitorTargetEnabled: true
                  isStorageSecondaryKeyInUse: false
                  predicateExpression: statement = 'select 1'
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/databases/extendedAuditingSettings
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                name: default
                properties:
                  auditActionsAndGroups:
                    - DATABASE_LOGOUT_GROUP
                    - DATABASE_ROLE_MEMBER_CHANGE_GROUP
                    - UPDATE on database::TestDatabaseName by public
                  isAzureMonitorTargetEnabled: true
                  isStorageSecondaryKeyInUse: false
                  predicateExpression: statement = 'select 1'
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/databases/extendedAuditingSettings
        Create or update an extended database's blob auditing policy with minimal parameters:
          parameters:
            api-version: 2017-03-01-preview
            blobAuditingPolicyName: default
            databaseName: testdb
            parameters:
              properties:
                state: Enabled
                storageAccountAccessKey: sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==
                storageEndpoint: https://mystorage.blob.core.windows.net
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: false
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/databases/extendedAuditingSettings
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: false
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 0
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/databases/extendedAuditingSettings
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}":
    get:
      description: Gets an extended server's blob auditing policy.
      operationId: ExtendedServerBlobAuditingPolicies_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/BlobAuditingPolicyNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the extended server blob auditing policy.
          schema:
            $ref: "#/definitions/ExtendedServerBlobAuditingPolicy"
        default:
          description: |-
            *** Error Responses: ***

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.
      tags:
        - BlobAuditing
      x-ms-examples:
        Get a server's blob extended auditing policy:
          parameters:
            api-version: 2017-03-01-preview
            blobAuditingPolicyName: default
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/extendedAuditingSettings/default
                name: default
                properties:
                  auditActionsAndGroups: []
                  isAzureMonitorTargetEnabled: false
                  isStorageSecondaryKeyInUse: false
                  predicateExpression: object_name = 'SensitiveData'
                  retentionDays: 0
                  state: Disabled
                  storageAccountSubscriptionId: 00000000-0000-0000-0000-000000000000
                  storageEndpoint: ""
                type: Microsoft.Sql/servers/extendedAuditingSettings
    put:
      description: Creates or updates an extended server's blob auditing policy.
      operationId: ExtendedServerBlobAuditingPolicies_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/BlobAuditingPolicyNameParameter"
        - description: Properties of extended blob auditing policy
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ExtendedServerBlobAuditingPolicy"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully updated the extended auditing settings.
          schema:
            $ref: "#/definitions/ExtendedServerBlobAuditingPolicy"
        "202":
          description: Updating the extended auditing settings is in progress.
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidServerBlobAuditingPolicyCreateRequest - The create server blob auditing policy request does not exist or has no properties object.

             * 400 InvalidBlobAuditActionsAndGroups - Invalid audit actions or action groups.

             * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.

             * 400 BlobAuditingPredicateExpressionEmpty - Invalid parameter 'predicateExpression', value can not be empty.

             * 400 InvalidBlobAuditActionsAndGroups - Invalid audit actions or action groups.

             * 400 InvalidBlobAuditActions - Invalid audit action

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

             * 409 ServerBlobAuditingPolicyInProgress - Set server blob auditing is already in progress.
      tags:
        - BlobAuditing
      x-ms-examples:
        Update a server's extended blob auditing policy with all parameters:
          parameters:
            api-version: 2017-03-01-preview
            blobAuditingPolicyName: default
            parameters:
              properties:
                auditActionsAndGroups:
                  - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                  - FAILED_DATABASE_AUTHENTICATION_GROUP
                  - BATCH_COMPLETED_GROUP
                isAzureMonitorTargetEnabled: true
                isStorageSecondaryKeyInUse: false
                predicateExpression: object_name = 'SensitiveData'
                retentionDays: 6
                state: Enabled
                storageAccountAccessKey: sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==
                storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                storageEndpoint: https://mystorage.blob.core.windows.net
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/extendedAuditingSettings/default
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: true
                  isStorageSecondaryKeyInUse: false
                  predicateExpression: object_name = 'SensitiveData'
                  retentionDays: 6
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/extendedAuditingSettings
            "202":
              operation: UpsertServerEngineAuditingPolicy
              startTime: 2017-11-22T09:34:54.72Z
        Update a server's extended blob auditing policy with minimal parameters:
          parameters:
            api-version: 2017-03-01-preview
            blobAuditingPolicyName: default
            parameters:
              properties:
                state: Enabled
                storageAccountAccessKey: sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==
                storageEndpoint: https://mystorage.blob.core.windows.net
            resourceGroupName: blobauditingtest-4799
            serverName: blobauditingtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/extendedAuditingSettings/default
                name: default
                properties:
                  auditActionsAndGroups:
                    - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
                    - FAILED_DATABASE_AUTHENTICATION_GROUP
                    - BATCH_COMPLETED_GROUP
                  isAzureMonitorTargetEnabled: false
                  isStorageSecondaryKeyInUse: false
                  retentionDays: 6
                  state: Enabled
                  storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
                  storageEndpoint: https://mystorage.blob.core.windows.net
                type: Microsoft.Sql/servers/extendedAuditingSettings
            "202":
              operation: UpsertServerEngineAuditingPolicy
              startTime: 2017-11-22T09:34:54.72Z
      x-ms-long-running-operation: true
definitions:
  DatabaseBlobAuditingPolicy:
    allOf:
      - allOf:
          - description: ARM resource.
            properties:
              id:
                description: Resource ID.
                readOnly: true
                type: string
              name:
                description: Resource name.
                readOnly: true
                type: string
              type:
                description: Resource type.
                readOnly: true
                type: string
            type: object
            x-ms-azure-resource: true
        description: ARM proxy resource.
        properties: {}
        type: object
    description: A database blob auditing policy.
    properties:
      kind:
        description: Resource kind.
        readOnly: true
        type: string
      properties:
        $ref: "#/definitions/DatabaseBlobAuditingPolicyProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
  DatabaseBlobAuditingPolicyListResult:
    description: A list of database auditing settings.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/DatabaseBlobAuditingPolicy"
        readOnly: true
        type: array
    type: object
  DatabaseBlobAuditingPolicyProperties:
    description: Properties of a database blob auditing policy.
    properties:
      auditActionsAndGroups:
        description: "Specifies the Actions-Groups and Actions to audit.\r

          \r

          The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:\r

          \r

          BATCH_COMPLETED_GROUP,\r

          SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,\r

          FAILED_DATABASE_AUTHENTICATION_GROUP.\r

          \r

          This above combination is also the set that is configured by default when enabling auditing from the Azure portal.\r

          \r

          The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):\r

          \r

          APPLICATION_ROLE_CHANGE_PASSWORD_GROUP\r

          BACKUP_RESTORE_GROUP\r

          DATABASE_LOGOUT_GROUP\r

          DATABASE_OBJECT_CHANGE_GROUP\r

          DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP\r

          DATABASE_OBJECT_PERMISSION_CHANGE_GROUP\r

          DATABASE_OPERATION_GROUP\r

          DATABASE_PERMISSION_CHANGE_GROUP\r

          DATABASE_PRINCIPAL_CHANGE_GROUP\r

          DATABASE_PRINCIPAL_IMPERSONATION_GROUP\r

          DATABASE_ROLE_MEMBER_CHANGE_GROUP\r

          FAILED_DATABASE_AUTHENTICATION_GROUP\r

          SCHEMA_OBJECT_ACCESS_GROUP\r

          SCHEMA_OBJECT_CHANGE_GROUP\r

          SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP\r

          SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP\r

          SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP\r

          USER_CHANGE_PASSWORD_GROUP\r

          BATCH_STARTED_GROUP\r

          BATCH_COMPLETED_GROUP\r

          \r

          These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.\r

          \r

          For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).\r

          \r

          For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:\r

          SELECT\r

          UPDATE\r

          INSERT\r

          DELETE\r

          EXECUTE\r

          RECEIVE\r

          REFERENCES\r

          \r

          The general form for defining an action to be audited is:\r

          {action} ON {object} BY {principal}\r

          \r

          Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.\r

          \r

          For example:\r

          SELECT on dbo.myTable by public\r

          SELECT on DATABASE::myDatabase by public\r

          SELECT on SCHEMA::mySchema by public\r

          \r

          For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)"
        items:
          type: string
        type: array
      isAzureMonitorTargetEnabled:
        description: "Specifies whether audit events are sent to Azure Monitor. \r

          In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.\r

          \r

          When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.\r

          Note that for server level audit you should use the 'master' database as {databaseName}.\r

          \r

          Diagnostic Settings URI format:\r

          PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview\r

          \r

          For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)\r

          or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)\r\n"
        type: boolean
      isStorageSecondaryKeyInUse:
        description: Specifies whether storageAccountAccessKey value is the storage's secondary key.
        type: boolean
      queueDelayMs:
        description: "Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.\r

          The default minimum value is 1000 (1 second). The maximum is 2,147,483,647."
        format: int32
        type: integer
      retentionDays:
        description: Specifies the number of days to keep in the audit logs in the storage account.
        format: int32
        type: integer
      state:
        description: Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
        enum:
          - Enabled
          - Disabled
        type: string
        x-ms-enum:
          modelAsString: false
          name: BlobAuditingPolicyState
      storageAccountAccessKey:
        description: Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required.
        type: string
        x-ms-mutability:
          - create
          - update
      storageAccountSubscriptionId:
        description: Specifies the blob storage subscription Id.
        format: uuid
        type: string
      storageEndpoint:
        description: Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
        type: string
    required:
      - state
    type: object
  ExtendedDatabaseBlobAuditingPolicy:
    allOf:
      - allOf:
          - description: ARM resource.
            properties:
              id:
                description: Resource ID.
                readOnly: true
                type: string
              name:
                description: Resource name.
                readOnly: true
                type: string
              type:
                description: Resource type.
                readOnly: true
                type: string
            type: object
            x-ms-azure-resource: true
        description: ARM proxy resource.
        properties: {}
        type: object
    description: An extended database blob auditing policy.
    properties:
      properties:
        $ref: "#/definitions/ExtendedDatabaseBlobAuditingPolicyProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
  ExtendedDatabaseBlobAuditingPolicyProperties:
    description: Properties of an extended database blob auditing policy.
    properties:
      auditActionsAndGroups:
        description: "Specifies the Actions-Groups and Actions to audit.\r

          \r

          The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:\r

          \r

          BATCH_COMPLETED_GROUP,\r

          SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,\r

          FAILED_DATABASE_AUTHENTICATION_GROUP.\r

          \r

          This above combination is also the set that is configured by default when enabling auditing from the Azure portal.\r

          \r

          The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):\r

          \r

          APPLICATION_ROLE_CHANGE_PASSWORD_GROUP\r

          BACKUP_RESTORE_GROUP\r

          DATABASE_LOGOUT_GROUP\r

          DATABASE_OBJECT_CHANGE_GROUP\r

          DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP\r

          DATABASE_OBJECT_PERMISSION_CHANGE_GROUP\r

          DATABASE_OPERATION_GROUP\r

          DATABASE_PERMISSION_CHANGE_GROUP\r

          DATABASE_PRINCIPAL_CHANGE_GROUP\r

          DATABASE_PRINCIPAL_IMPERSONATION_GROUP\r

          DATABASE_ROLE_MEMBER_CHANGE_GROUP\r

          FAILED_DATABASE_AUTHENTICATION_GROUP\r

          SCHEMA_OBJECT_ACCESS_GROUP\r

          SCHEMA_OBJECT_CHANGE_GROUP\r

          SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP\r

          SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP\r

          SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP\r

          USER_CHANGE_PASSWORD_GROUP\r

          BATCH_STARTED_GROUP\r

          BATCH_COMPLETED_GROUP\r

          \r

          These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.\r

          \r

          For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).\r

          \r

          For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:\r

          SELECT\r

          UPDATE\r

          INSERT\r

          DELETE\r

          EXECUTE\r

          RECEIVE\r

          REFERENCES\r

          \r

          The general form for defining an action to be audited is:\r

          {action} ON {object} BY {principal}\r

          \r

          Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.\r

          \r

          For example:\r

          SELECT on dbo.myTable by public\r

          SELECT on DATABASE::myDatabase by public\r

          SELECT on SCHEMA::mySchema by public\r

          \r

          For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)"
        items:
          type: string
        type: array
      isAzureMonitorTargetEnabled:
        description: "Specifies whether audit events are sent to Azure Monitor. \r

          In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.\r

          \r

          When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.\r

          Note that for server level audit you should use the 'master' database as {databaseName}.\r

          \r

          Diagnostic Settings URI format:\r

          PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview\r

          \r

          For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)\r

          or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)\r\n"
        type: boolean
      isStorageSecondaryKeyInUse:
        description: Specifies whether storageAccountAccessKey value is the storage's secondary key.
        type: boolean
      predicateExpression:
        description: Specifies condition of where clause when creating an audit.
        type: string
      queueDelayMs:
        description: "Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.\r

          The default minimum value is 1000 (1 second). The maximum is 2,147,483,647."
        format: int32
        type: integer
      retentionDays:
        description: Specifies the number of days to keep in the audit logs in the storage account.
        format: int32
        type: integer
      state:
        description: Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
        enum:
          - Enabled
          - Disabled
        type: string
        x-ms-enum:
          modelAsString: false
          name: BlobAuditingPolicyState
      storageAccountAccessKey:
        description: Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required.
        type: string
        x-ms-mutability:
          - create
          - update
      storageAccountSubscriptionId:
        description: Specifies the blob storage subscription Id.
        format: uuid
        type: string
      storageEndpoint:
        description: Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
        type: string
    required:
      - state
    type: object
  ExtendedServerBlobAuditingPolicy:
    allOf:
      - allOf:
          - description: ARM resource.
            properties:
              id:
                description: Resource ID.
                readOnly: true
                type: string
              name:
                description: Resource name.
                readOnly: true
                type: string
              type:
                description: Resource type.
                readOnly: true
                type: string
            type: object
            x-ms-azure-resource: true
        description: ARM proxy resource.
        properties: {}
        type: object
    description: An extended server blob auditing policy.
    properties:
      properties:
        $ref: "#/definitions/ExtendedServerBlobAuditingPolicyProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
  ExtendedServerBlobAuditingPolicyProperties:
    description: Properties of an extended server blob auditing policy.
    properties:
      auditActionsAndGroups:
        description: "Specifies the Actions-Groups and Actions to audit.\r

          \r

          The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:\r

          \r

          BATCH_COMPLETED_GROUP,\r

          SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,\r

          FAILED_DATABASE_AUTHENTICATION_GROUP.\r

          \r

          This above combination is also the set that is configured by default when enabling auditing from the Azure portal.\r

          \r

          The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):\r

          \r

          APPLICATION_ROLE_CHANGE_PASSWORD_GROUP\r

          BACKUP_RESTORE_GROUP\r

          DATABASE_LOGOUT_GROUP\r

          DATABASE_OBJECT_CHANGE_GROUP\r

          DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP\r

          DATABASE_OBJECT_PERMISSION_CHANGE_GROUP\r

          DATABASE_OPERATION_GROUP\r

          DATABASE_PERMISSION_CHANGE_GROUP\r

          DATABASE_PRINCIPAL_CHANGE_GROUP\r

          DATABASE_PRINCIPAL_IMPERSONATION_GROUP\r

          DATABASE_ROLE_MEMBER_CHANGE_GROUP\r

          FAILED_DATABASE_AUTHENTICATION_GROUP\r

          SCHEMA_OBJECT_ACCESS_GROUP\r

          SCHEMA_OBJECT_CHANGE_GROUP\r

          SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP\r

          SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP\r

          SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP\r

          USER_CHANGE_PASSWORD_GROUP\r

          BATCH_STARTED_GROUP\r

          BATCH_COMPLETED_GROUP\r

          \r

          These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.\r

          \r

          For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).\r

          \r

          For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:\r

          SELECT\r

          UPDATE\r

          INSERT\r

          DELETE\r

          EXECUTE\r

          RECEIVE\r

          REFERENCES\r

          \r

          The general form for defining an action to be audited is:\r

          {action} ON {object} BY {principal}\r

          \r

          Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.\r

          \r

          For example:\r

          SELECT on dbo.myTable by public\r

          SELECT on DATABASE::myDatabase by public\r

          SELECT on SCHEMA::mySchema by public\r

          \r

          For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)"
        items:
          type: string
        type: array
      isAzureMonitorTargetEnabled:
        description: "Specifies whether audit events are sent to Azure Monitor. \r

          In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.\r

          \r

          When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.\r

          Note that for server level audit you should use the 'master' database as {databaseName}.\r

          \r

          Diagnostic Settings URI format:\r

          PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview\r

          \r

          For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)\r

          or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)\r\n"
        type: boolean
      isStorageSecondaryKeyInUse:
        description: Specifies whether storageAccountAccessKey value is the storage's secondary key.
        type: boolean
      predicateExpression:
        description: Specifies condition of where clause when creating an audit.
        type: string
      queueDelayMs:
        description: "Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.\r

          The default minimum value is 1000 (1 second). The maximum is 2,147,483,647."
        format: int32
        type: integer
      retentionDays:
        description: Specifies the number of days to keep in the audit logs in the storage account.
        format: int32
        type: integer
      state:
        description: Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
        enum:
          - Enabled
          - Disabled
        type: string
        x-ms-enum:
          modelAsString: false
          name: BlobAuditingPolicyState
      storageAccountAccessKey:
        description: Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required.
        type: string
        x-ms-mutability:
          - create
          - update
      storageAccountSubscriptionId:
        description: Specifies the blob storage subscription Id.
        format: uuid
        type: string
      storageEndpoint:
        description: Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
        type: string
    required:
      - state
    type: object
  ServerBlobAuditingPolicy:
    allOf:
      - allOf:
          - description: ARM resource.
            properties:
              id:
                description: Resource ID.
                readOnly: true
                type: string
              name:
                description: Resource name.
                readOnly: true
                type: string
              type:
                description: Resource type.
                readOnly: true
                type: string
            type: object
            x-ms-azure-resource: true
        description: ARM proxy resource.
        properties: {}
        type: object
    description: A server blob auditing policy.
    properties:
      properties:
        $ref: "#/definitions/ServerBlobAuditingPolicyProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
  ServerBlobAuditingPolicyListResult:
    description: A list of server auditing settings.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/ServerBlobAuditingPolicy"
        readOnly: true
        type: array
    type: object
  ServerBlobAuditingPolicyProperties:
    description: Properties of a server blob auditing policy.
    properties:
      auditActionsAndGroups:
        description: "Specifies the Actions-Groups and Actions to audit.\r

          \r

          The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:\r

          \r

          BATCH_COMPLETED_GROUP,\r

          SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,\r

          FAILED_DATABASE_AUTHENTICATION_GROUP.\r

          \r

          This above combination is also the set that is configured by default when enabling auditing from the Azure portal.\r

          \r

          The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):\r

          \r

          APPLICATION_ROLE_CHANGE_PASSWORD_GROUP\r

          BACKUP_RESTORE_GROUP\r

          DATABASE_LOGOUT_GROUP\r

          DATABASE_OBJECT_CHANGE_GROUP\r

          DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP\r

          DATABASE_OBJECT_PERMISSION_CHANGE_GROUP\r

          DATABASE_OPERATION_GROUP\r

          DATABASE_PERMISSION_CHANGE_GROUP\r

          DATABASE_PRINCIPAL_CHANGE_GROUP\r

          DATABASE_PRINCIPAL_IMPERSONATION_GROUP\r

          DATABASE_ROLE_MEMBER_CHANGE_GROUP\r

          FAILED_DATABASE_AUTHENTICATION_GROUP\r

          SCHEMA_OBJECT_ACCESS_GROUP\r

          SCHEMA_OBJECT_CHANGE_GROUP\r

          SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP\r

          SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP\r

          SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP\r

          USER_CHANGE_PASSWORD_GROUP\r

          BATCH_STARTED_GROUP\r

          BATCH_COMPLETED_GROUP\r

          \r

          These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.\r

          \r

          For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).\r

          \r

          For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:\r

          SELECT\r

          UPDATE\r

          INSERT\r

          DELETE\r

          EXECUTE\r

          RECEIVE\r

          REFERENCES\r

          \r

          The general form for defining an action to be audited is:\r

          {action} ON {object} BY {principal}\r

          \r

          Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.\r

          \r

          For example:\r

          SELECT on dbo.myTable by public\r

          SELECT on DATABASE::myDatabase by public\r

          SELECT on SCHEMA::mySchema by public\r

          \r

          For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)"
        items:
          type: string
        type: array
      isAzureMonitorTargetEnabled:
        description: "Specifies whether audit events are sent to Azure Monitor. \r

          In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.\r

          \r

          When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.\r

          Note that for server level audit you should use the 'master' database as {databaseName}.\r

          \r

          Diagnostic Settings URI format:\r

          PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview\r

          \r

          For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)\r

          or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)\r\n"
        type: boolean
      isStorageSecondaryKeyInUse:
        description: Specifies whether storageAccountAccessKey value is the storage's secondary key.
        type: boolean
      queueDelayMs:
        description: "Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.\r

          The default minimum value is 1000 (1 second). The maximum is 2,147,483,647."
        format: int32
        type: integer
      retentionDays:
        description: Specifies the number of days to keep in the audit logs in the storage account.
        format: int32
        type: integer
      state:
        description: Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
        enum:
          - Enabled
          - Disabled
        type: string
        x-ms-enum:
          modelAsString: false
          name: BlobAuditingPolicyState
      storageAccountAccessKey:
        description: Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required.
        type: string
        x-ms-mutability:
          - create
          - update
      storageAccountSubscriptionId:
        description: Specifies the blob storage subscription Id.
        format: uuid
        type: string
      storageEndpoint:
        description: Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
        type: string
    required:
      - state
    type: object
