Edit

Manage Azure SQL Database Auditing using APIs

Applies to: Azure SQL Database

This article provides an overview of the different APIs for managing auditing for Azure SQL Database.

Use Azure PowerShell

PowerShell cmdlets (including WHERE clause support for additional filtering):

For a script example, see Configure auditing and threat detection using PowerShell.

Use REST API

REST API:

Extended policy with WHERE clause support for additional filtering:

Use Azure CLI

Use Azure Resource Manager templates

You can manage Azure SQL Database auditing using Azure Resource Manager templates, as shown in these examples:

Note

The linked samples are on an external public repository and are provided 'as is', without warranty, and are not supported under any Microsoft support program/service.

Auditing in Azure Synapse Analytics

For information about managing auditing by using APIs in Azure Synapse Analytics, see Manage auditing using APIs.