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 more about Azure SQL Database – Enroll to our Online Course!

Enroll to our online course on Udemy titled “Introduction to Azure SQL Database for Beginners” and get lifetime access to high-quality lessons and hands-on guides about all the aspects of Azure SQL Database.

Introduction to Azure SQL Database (Online Course - Lifetime Access)
(Lifetime Access/ Live Demos / Downloadable Resources and more!)

Learn More


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.

 

Conclusion

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.

 

Learn more about Azure SQL Database

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!

Introduction to Azure SQL Database (Online Course - Lifetime Access)
(Lifetime Access/ Live Demos / Downloadable Resources and more!)

Learn More

 

 

Learn More

 

Featured Online Courses:

 

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 (2 votes, average: 5.00 out of 5)

Loading...

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

© SQLNetHub