Enable table level auditing in Azure SQL DB

Vijay Kumar 1,996 Reputation points
2022-04-27T17:36:33.733+00:00

Hi Team,

How to enable table level auditing in Azure SQL DB and Azure SQL MI?

We want to only enable auditing on certain table not on entire database.

Azure SQL Database
0 comments No comments
{count} vote

Accepted answer
  1. Alberto Morillo 27,781 Reputation points MVP
    2022-04-27T20:13:10.29+00:00

    You can set up the audit as shown below:

    Set-AzureRmSqlDatabaseAuditing -ResourceGroupName "resourceGroup"  
     -ServerName "SQL Server Name" -DatabaseName "AdventureWorksLT"    
     -StorageAccountName "storageAccount"   
    -AuditActionGroup "SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP", "FAILED_DATABASE_AUTHENTICATION_GROUP", "BATCH_COMPLETED_GROUP"   
     -AuditAction "SELECT ON dbo.myTable BY public"    
     -RetentionInDays 60  
    

    See the audit action available at the database level here.

    More AuditActions at the table level:

    -AuditAction "DELETE ON dbo.myTable BY public"
    -AuditAction "UPDATE ON dbo.myTable BY public"
    -AuditAction "INSERT ON dbo.myTable BY public"


0 additional answers

Sort by: Most helpful