Other Articles

SQL Server – Enable Auditing

Secure Configuration Checks > Azure

This check ensures that auditing is enabled on Azure SQL servers. Auditing records database events, such as logins, queries and changes to permissions, and writes them to a storage account, Log Analytics workspace or Event Hub for security review.

Check Details

  • Resource: SQL Server
  • Check: Enable SQL Server Auditing
  • Risk: If auditing is disabled, suspicious activity and unauthorized changes cannot be detected or investigated, and there is no audit trail for compliance.

Remediation via Azure Portal

  1. Log in to the Azure Portal. Azure Portal dashboard
  2. Navigate to SQL servers and select the affected SQL server. SQL servers list
  3. In the left menu, click on Auditing under Security. Auditing in the SQL server menu
  4. Turn on Enable Azure SQL Auditing.
  5. Select one or more audit log destinations: Storage, Log Analytics or Event Hub, and fill in the required details (for example, the storage account or workspace). Audit log destination selected
  6. Click Save to apply the changes.

Remediation via Azure CLI

  1. Open Azure Cloud Shell from the Azure Portal or use a local terminal with Azure CLI installed. Azure Cloud Shell
  2. Run the following command to enable auditing to a storage account:
    az sql server audit-policy update \
    --resource-group <resource-group-name> \
    --name <sql-server-name> \
    --state Enabled \
    --blob-storage-target-state Enabled \
    --storage-account <storage-account-name> \
    --retention-days <retention-days>
    

    Replace <resource-group-name>, <sql-server-name>, <storage-account-name> and <retention-days> with your actual values. Auditing enabled on the server applies to all databases on that server.

Updated on 03 November, 2026