az sql server update-auditing
command to enable auditing for the Azure SQL Server.--state Enabled
and --storage-account-resource-id
to configure auditing settings.az sql server update-auditing --resource-group <resource-group-name> --name <sql-server-name> --state Enabled --storage-account-resource-id <storage-account-resource-id>
az monitor diagnostic-settings create
command to enable diagnostic settings for the Azure SQL Database.--name
, --resource-id
, and --workspace
.az monitor diagnostic-settings create --name <diagnostic-settings-name> --resource <sql-database-resource-id> --workspace <log-analytics-workspace-id>
az sql db threat-policy update
command to enable threat detection for the Azure SQL Database.--name
, --resource-group
, and --storage-account
.az sql db threat-policy update --name <database-name> --resource-group <resource-group-name> --storage-account <storage-account-name> --state Enabled