Extended events error in Azure Managed instance

robin sql 1 Reputation point
2021-10-05T11:30:59.293+00:00

0

I have setup extended events on Managed instance. Below are the steps followed:

create a master key
Create a credential for Azure Blob storage with shared access token
Create the extended event and start the session
The session is running and I can see the file available in blob storage.

The issue is whenever I am trying to view the target data, I am getting the error:

The log file name "https//example.blob.core.windows.net/exevents/Alwaysonheath*.xel" is invalid. Verify that the file exists and that the sql server account has access to it. (Microsoft sql server, error: 25718)

when i run the query to fetch event data: SELECT event_data FROM sys.fn_xe_file_target_read_file (N'https//example.blob.core.windows.net/exevents/Alwaysonheath*.xel',NULL, NULL, NULL);

The result set is empty

Note: I can download the file from azure storage and view the content, only when trying to view target data I am getting the above error.

Can you please guide me what might be the issue

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,713 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 101K Reputation points MVP
    2021-10-05T21:50:20.29+00:00

    Maybe a silly question, buy shouldn't there be a colon after https? That is,

    SELECT event_data FROM sys.fn_xe_file_target_read_file (N'https://example.blob.core.windows.net/exevents/Alwaysonheath*.xel',NULL, NULL, NULL);
    

  2. YufeiShao-msft 7,056 Reputation points
    2021-10-06T06:59:57.307+00:00

    Hi @robin sql ,

    sys.fn_xe_file_target_read_file requires VIEW SERVER STATE permission on the server, please check it.

    Reading large result sets by executing sys.fn_xe_file_target_read_file in Management Studio may result in an error. May be you can use the Results to File mode (Ctrl+Shift+F) to export large result sets to a file and read the file with another tool instead.