Azure Log Analytics - SQL Managed Instance logs

Viewed 583

I need to retrieve executed sql queries by using log analytics. I have the log analytics workspace and also configured diagnostic settings (SQL managed instance and database). But there is no data when I try to execute the following kusto query:

AzureDiagnostics | where Category == "QueryStoreRuntimeStatistics"

Should I set up something more to see this data? (enable Query Store - Write and Read - directly on the SQL Server Database ?) In the AzureDiagnostic table I have only UsageStats and Erros.

1 Answers

We can check for SQL diagnostics information with help of log analytics workspace, below are few steps which we need to follow:

  1. Need to create a log analytics work space.
  2. Add few configurations to SQL such as enabling audit mode and select Log Analytics workspace.
  3. Enable diagnostics to Log Analytics.
  4. Select the check box for send data to log analytics. We can understand more about this from one of the Microsoft blogs.
Related