microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.57k stars 901 forks source link

Cannot connect to LogAnalytics database #15277

Open nielsams opened 3 years ago

nielsams commented 3 years ago

Issue Type: Bug

LogAnalytics databases are accessible through a Kusto endpoint on https://ade.loganalytics.io/subscriptions//resourcegroups//providers/microsoft.operationalinsights/workspaces/

Works in Kusto explorer, but in Data Studio for windows I'm getting: ApiContractViolationError: management command parsing failed with error: SyntaxError: Expected \"(\", \"identity\", \"schema\", \"with\", or end of input but \"|\" found

Extension version: 0.5.3 Azure Data Studio version: azuredatastudio 1.28.0 (13e362762762e5cb76a5c8afd2bc650f48c2d3d8, 2021-04-15T00:24:15.710Z) OS version: Windows_NT x64 10.0.19042

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.92GB (3.59GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
JosNun commented 3 years ago

Same issue here, though I'm attempting to connect to an AppInsights cluster, where the url is like https://ade.applicationinsights.io/subscriptions/<subscription-id>/resourcegroups/<resource-group-name>/providers/microsoft.insights/components/<ai-app-name>

Like you mentioned, it works fine in Azure Data Explorer, but cannot be connected to from Azure Data Studio.

MsSQLGirl commented 3 years ago

@nielsams We have recently shipped Azure Monitor Logs extension which allows you to connect to Log Analytics workspaces. Can you please see if this address the issue? More info on Azure Monitor Log extension

MsSQLGirl commented 3 years ago

Same issue here, though I'm attempting to connect to an AppInsights cluster, where the url is like https://ade.applicationinsights.io/subscriptions/<subscription-id>/resourcegroups/<resource-group-name>/providers/microsoft.insights/components/<ai-app-name>

Like you mentioned, it works fine in Azure Data Explorer, but cannot be connected to from Azure Data Studio.

@JosNun - App Insights is currently not supported in Azure Data Studio. Please do share your scenario and importance, so that we can triage and prioritize accordingly.

JosNun commented 3 years ago

In my case, I was planning on using Azure Data Studio to query App Insights instead of the Azure portal so I could use similar keybinds across SQL and Kusto queries (to different DBs, of course). In my particular case, I'm querying an Application Insights instance that hasn't been migrated to a Log Analytics Workspace. As far as importance, it can be low-priority, as it's just a matter of ergonomics, and I can still have the full functionality by running the queries in the Azure Portal.

MsSQLGirl commented 3 years ago

Got it. Thanks for sharing it @JosNun. Technically, there is a way to connect to the AppInsights data from Log Analytics workspace. (caveat: I've only used this a couple of times).

  1. From Azure Portal, navigate to your App Insights resource.
  2. Click on the workspace link on the App Insights resource (on the Overview page). This will help navigate you to the Log Analytics workspace associated to that App Insights.
  3. From here, you can use the workspace ID of the Log Analytics workspace, to connect to it in Azure Data Studio. It does show you all usage from all applications / services though. So you'll have to do some extra filtering.

Hope this helps.

Julie

JustinMDotNet commented 3 years ago

@nielsams @JosNun Have you been able to use the Azure Monitor Logs extension to connect to your workspaces? It's available in the Extension Marketplace.

image

JosNun commented 3 years ago

I haven't poked with it much, but I gave a cursory glance, and as far as I can tell, there is no Log Analytics Workspace associated with that instance of App Insights (It hasn't been migrated to Workspace-based Application Insights, if that helps). In the properties of that App Insights instance, the Workspace field is blank, as well. I also checked all the Log Analytics Workspaces I have access to, and I didn't see the log data there, either. I may have just missed something, but it may just be that connecting to a classic Application Insights resource isn't doable atm.

nielsams commented 2 years ago

Thanks for your patience :) I can confirm that in my current Data Studio version 1.34.0 this error persists and still presents the same.

Additionally, I tried to use the Azure Monitor Logs extension but also failed. I will open a separate issue since I'm not sure if this is related.