Compressing Audit log files on Azure Blob Storage using ADF Pipeline for Azure SQL Database

This post has been republished via RSS; it originally appeared at: Microsoft Tech Community - Latest Blogs - .

Auditing is a powerful security feature which is widely used by many customers. Customers must maintain audit logs for longer retention periods for their security & Compliance requirements. If you have longer retention periods, the audit logs for Azure Database can be huge and the storage can become costly. To save cost and maintain your audit logs for longer retention periods, you can compress the log files with help of a copy data tool from Azure data factory. You can configure the pipelines to compress and decompress audit log files using known compression technologies like WinZip, zipdeflate etc. In This blog I will show detailed steps below to create the pipelines 

Go to the Azure Portal and create a new Data Factory resource:  

 

SravaniSaluru_0-1676273051772.png

 

 

 

 

From the Azure Data Factory resource you created, click on the “Launch studio button shown below.  

 

SravaniSaluru_1-1676273051776.png

 

 

 

 

 

 

Data Factory offers different tools like: 

  • Ingest,  
  • Orchestrate,  
  • Transform data and  
  • Configure SSIS 

To learn more please refer to Azure Data Factory documentation. 

 

SravaniSaluru_2-1676273051779.png

 

 

Here we will use the copy data tool: Chose the “Ingest” option, then select the “built in copy task as below. You can run these pipelines on demand or schedule them as per your requirement:  

 

SravaniSaluru_3-1676273051784.png

 

 

The Copy data tool can be scheduled based on your requirement.  

 

SravaniSaluru_4-1676273051790.png

 

 

Using this tool you can copy the data from your source, compress it and write the data to a target. It has list of supported source and target data stores:  

SravaniSaluru_5-1676273051795.png

 

 

Select source as Azure Blob Storage., You can select an existing connection or create a new connection:  

 

SravaniSaluru_6-1676273051799.png

 

 

 

For a new connection fill in the details as required:  

SravaniSaluru_7-1676273051803.png

 

 

 

 

As we are trying to compress .xel files, check that the Binary copy option and compression type for source data source is “none” as the files are not compressed on the source.   

SravaniSaluru_8-1676273051809.png

 

 

 

Select the Destination data store, here we will use the same Azure Blob Storage to copy the compressed files but choose any location to keep the compressed files. 

For our example, we selected the Zipdeflate compression type. 

SravaniSaluru_9-1676273051814.png

 

 

 

 

 

 

 

 

 

 

SravaniSaluru_10-1676273051818.png

 

 

 

Below is the summary of the copy pipeline that will be created: 

 

SravaniSaluru_11-1676273051821.png

 

 

 

 

A sample Deployment status is shown below. If there are any errors, you can check and rectify if needed: 

SravaniSaluru_12-1676273051824.png

 

 

From Azure Data Studio monitor, you can check the status of the pipelines and run them on demand if required.  

 

SravaniSaluru_13-1676273051827.png

 

 

Similarly, you can create a pipeline to decompress the files and copy to the target:  

 

SravaniSaluru_14-1676273051831.png

 

 

Note: This will not control any manual actions that are taken like deletion of files etc. that need to be monitored by cloud administrators. The compressed files will not obey the retention configured for Audit and it must be maintained by administrators.  

 

The compressed files will be saved as below and if you want to save further cost you can try moving them to archive tier and move them back to hot storage tier when you must access them. Moving to archive tier is only applicable for servers that require retention greater than 180 days (about 6 months) and you do not have to access the files on regular basis.   

 

SravaniSaluru_15-1676273051834.png

 

 

 

 

To summarize, if you have long retention periods for audit logs and lots of data need to be stored in blob storage, you can use the ADF pipeline to compress /decompress audit logs which can incur space and cost savings. Once the audit log files are compressed, they are stored in block blob format, and you can move them to archive tier to store them for longer periods at lower cost. 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.