How to enable extended events in SQL Azure to blob storage running behind the VNET or Private Endpoints?
Recently I have come across an issue for enabling extended event to blob storage on Azure SQL Server and getting the below error.
The target, "5B2DA06D-898A-43C8-9309-39BBBE93EBBD.package0.event_file", encountered a configuration error during initialization. Object cannot be added to the event session. (null) (.Net SqlClient Data Provider)
Storage account was running behind the VNET.
Below are the steps required for creating extended event for the storage account is running behind the VNET.
Set identity for Azure SQL Server
Set-AzSqlServer -ResourceGroupName [ResourcegroupName] b -ServerName [AzureSQLServerName] -AssignIdentity
Provide the below permission to the storage account for respective Azure SQL Identity.
Ensure to add the necessary firewall and virtual network so that storage account can communicate with Azure SQL database.
Create credential in Azure SQL using Managed Identity.