As stated above, this is a built in feature to the Azure SQL Service. Assuming you are using Azure SQL Database, go into the logical server settings within the Azure Portal. Then under the Security section, you should see an option for 'Auditing'. Once you click that Auditing tab, you can enable auditing for the server and send your logs to a storage account.
how to write sql server audit log to azure storage account

i have azure sql , and i need to use bellow script to enable audit for selected objects, but i am not able to write the logs to azure storage account, i am getting below error
Msg 40517, Level 15, State 5, Line 7
Keyword or statement option 'FILE' is not supported in this version of SQL Server.
-- Use the master database for creating the audit
USE master;
GO
-- Create a Server Audit object
CREATE SERVER AUDIT DataAudit
--- TO azure storage account
WITH (ON_FAILURE = CONTINUE);
GO
-- Enable the Server Audit
ALTER SERVER AUDIT DataAudit
WITH (STATE = ON);
GO
2 answers
Sort by: Most helpful
-
-
Oury Ba-MSFT 11,381 Reputation points Microsoft Employee
2023-05-24T18:32:20.8866667+00:00 k shaz Thank you for reaching out.
My understanding is that you are trying to set up auditing for your Azure SQL database.
In addition to @Tamarick Hill 's answer.
For Azure SQL, the portal experience is the best way to do it, we don't have t-SQL support yet. Please check the doc below for step-by-step instructions.
Set up Auditing for Azure SQL Database and Azure Synapse Analytics
Regards,
Oury