Enabling Auditing in Azure SQL Database

Enabling Auditing in Azure SQL Database

Enabling Auditing in Azure SQL Database

Enabling auditing in Azure SQL Database is a very good idea, since it allows you get alerts on a variety of actions and behaviors. Since data is the most valuable asset in any organization, it is always a good idea, if not a necessity, not only having your database servers and instances secured, but also having them audited. Read on to learn more about auditing in Azure SQL Database.


Different Ways to Enable Auditing in Azure SQL Database

To enable auditing, you can either navigate directly to Azure SQL Database, click on “Auditing” and turn it ON, along with following the on-screen instructions, or you might get an Azure Advisor recommendation to do it.

In either way, you will end up to the same setup dialogs.


Learn all about Azure SQL Database both Platform as a Service (PaaS) and Infrastructure as a Service (IaaS). Check our online course “Introduction to Azure SQL Database” (lifetime access).


Example of Enabling Azure SQL Database Auditing via an Azure Advisor’s Recommendation

In the example I’m presenting below, I follow the second way, where I have received an Advisor recommendation for my test Azure SQL Database instance.


The recommendation to enable Auditing for Azure SQL Database

So, in the first screen below, you can see that I was recommended to enable Auditing.

Enabling Auditing in Azure SQL Database - SQLNetHub


Since I agreed with the recommendation, I proceeded and chose to enable it and set “Log Analytics” as the audit log destination.

Enabling Auditing in Azure SQL Database - SQLNetHub


Create a Log Analytics workspace

So, the first step is to create an OMS workspace along with a Log analytics workspace:

Enabling Auditing in Azure SQL Database - SQLNetHub


Great. Now, Auditing is enabled and Log Analytics is set as the audit logs destination.

Enabling Auditing in Azure SQL Database - SQLNetHub


Create an Alert Rule

The next step is to see how we can create Alert Rules. In the below screenshot, I’m creating a new alert rule.

To this end, I have to:

  1. Specify alert condition
  2. Define alert details
  3. Define action group

Enabling Auditing in Azure SQL Database - SQLNetHub


As you can in the above screenshot, I have created an alert rule with the following characteristics:

  • The alert target are All SQL servers.
  • The alert criteria is to trigger an alert whenever anyone deletes an Azure SQL Server (any status).
  • In the alert details I selected the resource type and group, and raised the level to “Critical”.
  • As an action group I created one which I named “Test” and set as an action to send me an email whenever the alert is triggered.


That’s it! Whenever an action that matches the alert criteria takes place, I will be notified by an email alert.



This was a simple example of how you can enable Azure SQL Database Auditing, after you get an Azure Advisor recommendation. However, you should not wait for an Advisor’s recommendation to do this. Since data is the most important asset within an organization, you should always have Auditing enabled, accompanied by a set of carefully designed alert rules and actions. This, can help you have more control on what’s going on not only with Azure SQL Database, but also with any resource you have on Azure.


See More!

Learn more about Azure SQL Database and get started fast and easy! Through our online course, you will get lifetime access to a comprehensive set of lectures and live demonstrations that will get you started with Azure SQL Database in no time! The course is regularly updated with additional educational material!

Enroll Now with Discount!


Introduction to Azure SQL Database (Online Course - Lifetime Access)

Introduction to Azure SQL Database (Online Course – Lifetime Access)


Learn More


Read Also


Check our latest software releases!

Easily generate SQL code snippets with Snippets Generator!

Convert static T-SQL to dynamic and vice versa with Dynamic SQL Generator.

Secure your SQL Server instances with DBA Security Advisor.

Benchmark SQL Server memory-optimized tables with In-Memory OLTP Simulator.


Rate this article: 1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)


Reference: SQLNetHub.com (https://www.sqlnethub.com)

© 2018 SQLNetHub


Artemakis Artemiou
Artemakis Artemiou is a Senior SQL Server Architect, Author, and a 9 Times Microsoft Data Platform MVP (2009-2018). He has over 15 years of experience in the IT industry in various roles. Artemakis is the founder of SQLNetHub and TechHowTos.com. Artemakis is the creator of the well-known software tools Snippets Generator and DBA Security Advisor. Also, he is the author of many eBooks on SQL Server. Artemakis currently serves as the President of the Cyprus .NET User Group (CDNUG) and the International .NET Association Country Leader for Cyprus (INETA). Artemakis's official website can be found at aartemiou.com.