get data from azure audit log file to sql server

Luan Truong Thanh 21 Reputation points
2021-03-13T08:31:35.513+00:00

Hello,

I am database administrator use azure sql database and sql server
I want to query data from azure audit log in a table of sql server
It mean I must import data from azure audit log files (.xel) to sql server each hour by schedule job
My ideas is need get list audit file and check which new file and then get data file by file in a loop
I know use sys.fn_get_audit_file to get data from audit file, but don't know get list azure audit file
Please kindly help me script to get list azure audit files
Or Which solution to pull data from Azure audit file to sql server.
Thank you so much

Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Vaibhav Chaudhari 38,916 Reputation points Volunteer Moderator
    2021-03-13T09:00:13.127+00:00

    Probably, you can enable audit logging to push log data to Log Analytics workspace and write KQL queries similar to SQL and query the data in Log analytics workspace? This is the main use case and the reason Log analytics was developed.

    Load xel files from Azure storage to SQL would be complex. Not sure how this can be achieved. Azure data factory is used to copy data from storage account but only csv, text, parquet files etc.. not .xel.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.