Hi @Pradyumn Joshi,
Thank you for reaching out to Microsoft QA.
To track which users are executing Insert, Update, or Delete commands in Azure Synapse, the most reliable and efficient way is to enable auditing on your Synapse dedicated SQL pool. Auditing captures detailed information about who ran what query, including the user's login ID and the type of command they executed.
Here’s how you can set it up:
First, go to your Synapse workspace in the Azure portal. Under the security settings, you’ll find an option to turn on auditing. When you enable this, the system will start logging all database activities, including the DML commands and it will store those logs in an Azure Storage account or other destinations you choose.
This approach is better than trying to monitor dynamic management views (DMVs) or Log Analytics tables because those only keep a limited number of records and often don’t include the user information you need. Auditing solves both of these problems by providing a comprehensive and persistent log of who did what and when.
So, in short, to track user identities running Insert/Update/Delete commands in Synapse, enable auditing on the SQL pool and regularly review your audit logs. This is the recommended way to get accurate, user-level visibility without adding overhead to your system.
Reference Links:
Auditing - Azure SQL Database and Azure Synapse Analytics | Microsoft Learn
https://learn.microsoft.com/en-us/sql/relational-databases/security/permissions-database-engine?view=sql-server-ver15
Follow-Up Questions:
- Is this a dedicated SQL pool or a serverless SQL pool?
- Has Diagnostic settings / Auditing been enabled on the pool? If yes, which Log Analytics workspace (name / workspace id)?
- Time window of interest (exact start/end UTC times) and example table(s) to focus on.
- Do we need real-time detection or historical (forensics) search?
- Any example statement text, login name, or client IP to filter on?
- Are there any compliance retention requirements for audit logs (how many days)?
I hope this helps you get started with tracking user activities in your Synapse environment! Let me know if you have any other questions!