Microsoft Azure – Configure Auditing for Azure SQL Database
In this article, we will look into the process of configuring auditing for the Azure SQL Database.
Follow the below steps to configure auditing for Azure SQL Database:
Step 1: Here in the portal, we’re looking at the Azure SQL Database, and down on the left under Security, we can select the Auditing tab.
Step 2: Now, this is where we would go if we want to enable auditing on just this particular database. However, if we want to enable it on all of the databases for the server, we can go ahead and click “View Server Settings”.
Step 3: From here, we can turn auditing on and we can select a few options. For example, you can see we’ve connected it to a storage account, and we can even select the Retention for how long we want to keep that data from the audits around.
In this case, we selected seven but we could put zero if I want to just keep collecting the audit data forever.
Step 4: Now, if we go back, we can also do something like enable Log Analytics. This is going to allow us to look at the audit logs and even get something like a Log Analytics dashboard related to security.
But in order to configure this, we basically have to select or create a Log Analytics Workspace. For this one, we went ahead and created one, aw-server0602-la. Basically, the name of the server is followed by LA for Log Analytics.
Now just go ahead and select “Save.”
Now, if I go back to the database, what we are going to see is that even though auditing is turned off for this database, auditing at the server level is enabled. What this means is that basically, if you have auditing enabled on the server, it’s going to be enabled for all of the databases in that logical server.
You can additionally turn on auditing for this specific database. Maybe for this database, you want to leverage Event Hub only and not Storage and Log Analytics, or you want to separate those workstreams. But if you enable it on the server, it’s automatically going to apply to all the databases on that server.
That was a quick demo to show you how to get set up with Azure SQL Database Auditing.