Posted in Azure Data Studio, SQL Notebooks

Troubleshooting Azure Data Studio

The TL;DR version of what you’re about to read is:

  • Azure Data Studio has log files that you can use to help you troubleshoot problems.

Why is this important to know? Because I’m always so proud of myself when I am able to figure out how to fix problems on my own.

Back in September, I was trying to install the .NET Interactive Notebooks for Azure Data Studio on my personal laptop as I’m trying to make sure my session on SQL Notebooks was all set for SQL Saturday Boston.

It had been failing over the summer but I hadn’t had time to make it a priority to fix. So now was the only time I had to do this.

I was getting error messages saying that 3.1.415 was the wrong version and I needed to install the latest .NET 6 version that was available. The thing is that I had installed it. In fact, my Add\Remove Program page in the Control Panel said I had multiple versions of .NET 6 installed. My first thought is that was causing a conflict so I uninstalled them all, downloaded the latest version of .NET 6, and installed that as administrator.

I went back to Azure Data Studio and I got the same error message. So I uninstalled .NET 6, uninstalled the .NET Interactive Notebook extension, reinstalled .NET 6 and then reinstalled the .NET Interactive Notebook extension.

And *sad trombone sound*, it failed.

Time to see if I could come up with anything with a search….

I don’t remember the search criteria, but I did stumble upon this page, Azure Data Studio Troubleshooting

As I read through this, I hit the section about Debug log location. I remember that I had a problem installing something on Azure Data Studio last summer and someone at Microsoft had helped me by pointing me to the log files.

So I hit Ctrl + Shift + P to access the Command Palette and wrote “Developer: Open Logs Folder”, like the web page suggested. But I noticed an option for “Developer: Open Extensions Log Folder” appear, and since an extension was what I was troubleshooting, I choose that.

Screenshot of the menu options when I hit Control + Shift + P in Azure Data Studio to access the Command Palette. I had typed developer: open logs. Two options appear: Developer: Open Extension Logs Folder and Developer: Open Logs Folder

And there in the main exhost1.log file, I found this:

[2022-10-02 19:19:24.429] [exthost] [error] Error: Unable to determine the version of the .NET SDK.
5.0.208 [C:\Program Files\dotnet\sdk]
5.0.214 [C:\Program Files\dotnet\sdk]
5.0.303 [C:\Program Files\dotnet\sdk]
6.0.401 [C:\Program Files\dotnet\sdk]
The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application '--version' does not exist.
  * You intended to execute a .NET SDK command:
      A compatible .NET SDK was not found.
Requested SDK version: 3.1.415
global.json file: C:\Users\Deborah\AppData\Local\Programs\Azure Data Studio\global.json
Installed SDKs:
Install the [3.1.415] .NET SDK or update [C:\Users\Deborah\AppData\Local\Programs\Azure Data Studio\global.json] to match an installed SDK.

So I opened the global.json, that I could find easily since the location was listed in the log file, and saw that it was set to the SDK, 3.1.415. I made a backup copy – just in case I messed things up, changed the version from 3.1.415 to 6.0.401, and saved the global.json file.

I then opened Azure Data Studio and reinstalled the .NET Interactive Notebooks extension. And what do you know? It worked! I didn’t get any messages saying I needed to install a version I had already installed and the extension did its job. My laptop was now ready to preset.

This was the second time that looking at the logs helped me fix a problem with trying to get something set up that wasn’t working as expected. Here’s hoping this quick story helps you (and me) the next time there’s an issue installing or upgrading something in Azure Data Studio. It may not solve everything but hopefully it gets you closer to finding out why you have problems to begin with.

One thought on “Troubleshooting Azure Data Studio

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s