{"id":35838,"date":"2021-09-16T09:00:52","date_gmt":"2021-09-16T16:00:52","guid":{"rendered":""},"modified":"2022-02-24T14:03:29","modified_gmt":"2022-02-24T22:03:29","slug":"enhance-your-log-analytics-data-exploration-in-azure-data-studio","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2021\/09\/16\/enhance-your-log-analytics-data-exploration-in-azure-data-studio\/","title":{"rendered":"Enhance your Log Analytics data exploration in Azure Data Studio"},"content":{"rendered":"
The Azure Monitor Logs extension in Azure Data Studio<\/a>\u00a0is now available in preview. The extension is supported in Azure Data Studio August 2021 release, v1.32.0.<\/p>\n Administrators can enable platform logging and metrics to one of their Azure services such as Azure SQL and set the destination to Log Analytics workspace. By installing native Azure Monitor Logs extension in Azure Data Studio, users can connect, browse, and query against Log Analytics workspace. Data professionals who are using Azure SQL, Azure PostgreSQL, or Azure Data Explorer in Azure Data Studio can access the data in the Log Analytics workspace for diagnosis or auditing in that same development environment. This native Azure Monitor Logs extension allows Azure service customers to also author notebooks with Log Analytics kernel, all equipped with Intellisense.<\/p>\n While the examples in this section are specific to Azure SQL scenarios, Azure Monitor Logs can also capture events from other Azure resources, such as Azure Functions or Azure Web Apps. Now, let\u2019s dive into these examples where users can leverage Log Analytics workspace data to better understand an Azure SQL database.<\/p>\n Connect to your Log Analytics workspace that captures the Azure SQL audit events. Right-click and choose New Query from the menu. Copy the following query and paste it to Query editor in Azure Data Studio.<\/p>\n In this example, a good question to ask might be, why are these users executing a lot of drops during this time?<\/p>\n Connect to your Log Analytics workspace that captures the Azure SQL error events. Right-click and choose New Notebook from the menu. Copy the following query and paste it to Query editor in Azure Data Studio.<\/p>\n In this example, we see a timeline with two-day intervals that maps error count by error number. A good question would be to understand why error 208 happens a lot.<\/p>\n Here are four key benefits of using Azure Monitor Logs extension in Azure Data Studio.<\/p>\n Other related extensions: Kusto (KQL) extension which works for Azure Data Explorer<\/a><\/p>\n This preview release is the beginning of a strategic journey to richer end-to-end DevOps with Data in Azure Data Studio. Please feel free to\u00a0submit your suggestions and bugs on GitHub<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":" The Azure Monitor Logs extension in Azure Data Studio\u00a0is now available in preview. The extension is supported in Azure Data Studio August 2021 release, v1.32.0. Administrators can enable platform logging and metrics to one of their Azure services such as Azure SQL and set the destination to Log Analytics workspace.<\/p>\n","protected":false},"author":6110,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","footnotes":""},"post_tag":[],"product":[2542],"content-type":[2448],"topic":[2469],"coauthors":[3563],"class_list":["post-35838","post","type-post","status-publish","format-standard","hentry","product-azure-data-studio","content-type-updates","topic-high-performance-database","review-flag-1593580361-1","review-flag-lever-1593580264-545","review-flag-new-1593580247-437"],"yoast_head":"\nExamples for Azure SQL users<\/h2>\n
Example One: Who dropped a table in my database?<\/h3>\n
AzureDiagnostics\n| where action_name_s == \"BATCH COMPLETED\"\n| where statement_s contains \"DROP TABLE\"\n| project TimeGenerated, Category, OperationName, server_principal_name_s, statement_s\n| sort by TimeGenerated desc\u00a0\n| take 10<\/pre>\n
<\/p>\nExample Two: What type of errors happen?<\/h3>\n
AzureDiagnostics\n|\u00a0where\u00a0OperationName\u00a0==\u00a0\"ErrorEvent\"\n|\u00a0extend\u00a0ErrorNumber\u00a0=\u00a0\u00a0toint(error_number_d)\u00a0\n|\u00a0summarize\u00a0event_count=count()\u00a0by\u00a0EventTime\u00a0=\u00a0bin(TimeGenerated,\u00a02d),\u00a0\u00a0ErrorNumber\n|\u00a0evaluate\u00a0pivot(ErrorNumber,\u00a0sum(event_count))\n|\u00a0sort\u00a0by\u00a0EventTime\u00a0asc<\/pre>\n
<\/p>\nOverall benefits<\/h2>\n
\n
How to get started<\/h2>\n
\n