How To Configure Auditing on Azure SQL Database with Selected Events

preview_player
Показать описание
Step 1: Setting the with right subscription

Set-AzContext -subscription yoursubscriptionid

Step2:To check the events
get-AzSqlDatabaseAudit -ResourceGroupName "urresorucegroupname" -ServerName "ursqlservername" -DatabaseName "urdbname"

Step3:Configure audit on selected events.

Set-AzSqlDatabaseAudit -ResourceGroupName test -ServerName testdemo07 -DatabaseName test -BlobStorageTargetState Enabled -StorageAccountResourceId "/subscriptions/aa9b3e61-1d08-430e-9e19-3ebd6e25bb2/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/testingtest123" -RetentionInDay 10 -PredicateExpression "statement like 'INSERT%' or statement like 'select%'"
Рекомендации по теме
Комментарии
Автор

I tried something like this to exclude all sql statements from Audit logs, however it doesn't work.I still get select statements logs in my audit logs. Do you have any suggestion?

Set-AzSqlServerAudit -ResourceGroupName "myresourcegroup" -ServerName "mysqlserver" -PredicateExpression "statement <> 'exec sp_executesql N%select%' or statement <> 'SELECT 1%'"

ajitavchatterjee
Автор

statement which are done by API is not capture through this, it is captured for database queries. please let me know how we can capture for activities which are done through any API

RajeevRanjan-nfxc
Автор

where can I get all the available events ?

somanathareddym