As part of the June 2021 GroupBy Conference, I watched Rob Sewell (b|t) present a session called “Notebooks, PowerShell and Excel Automation”. What I ended up learning from this was not the main point of the presentation (although it was some really cool stuff as you would expect from Rob), but more about the tool that he used.
These days, we tend to think Azure Data Studio when we database developers talk about notebooks, specifically SQL Notebooks. But what Rob used for his demos are a new functionality within VS Code called .NET Interactive Notebooks. It was developed in combination with the Azure Data Studio team and it has support for SQL. But the cool thing that intrigued me was that a notebook could support multiple kernels, unlike Azure Data Studio. Knowing how much we love our SQL and PowerShell and this being a feature that many of us want to see in SQL Notebooks, I decided to try and set this up and poke around.
I don’t consider myself much of a developer\app programmer so installing VS Code seems a little daunting because I think of it as a programmer’s tool and not a database developer’s tool. (I’m not sure why I have such a division in my head between SQL developers and developers of other languages, but I do. A topic for a different post, I guess…) But I already use Azure Data Studio so knowing that the code base is similar so the look and feel should be similar made it easier to take the leap.
.NET Interactive Notebooks are extensions of VS Code. So there is extra work you need to do to set them up. I went the website, made sure that I had all of the prerequisites installed – VS Code and .NET 5 SDK – and then installed the .NET Interactive extension.
In his session, Rob walks you through getting started with your first notebook. It looked simple enough. So I opened VS Code and hit Ctrl + Shift + P to get the drop down options menu. I then chose “.NET Interactive: Create new blank notebook”. I made sure that the notebook type was .NET Interactive and then I created a new code cell. I changed the type to SQL and tried out some code that I found:

So I went back and followed the direction. I tried the first command:

… and got an error. My Google\Bing-fu failed me so I decided to tweet about it, including the message:
When I’ve presented on SQL Notebooks, I have said one of the best things is how responsive the tools team is. And that’s what exactly happened. Jon Sequeira responded and followed up with me on this and requested that I open an bug on GitHub. After some follow up from Jon and his coworker Kevin, it turns out there may have been a missing line in my nuget.config file. (See GitHub for the full conversation.) There was no key in my PackageSources so nuget couldn’t pull down the files needed.
I added that missing line and I was off and running.
Unfortunately, I haven’t been able to play with it more than the initial set up. But I think there is some cool things that it could be used for.
A couple of things to keep an eye out for:
- The documentation still indicates that as of the writing of the post that it is in preview. I don’t know when that status will change but it means there will probably be changes to come.
- Not everything we find in SQL Notebooks in ADS is found within the .NET Interactive notebook. When you change the kernel for the cell, you’re only options are C#, F#, HTML, JavaScript, PowerShell and SQL – no Python or Spark like ADS.

There are other notebook types so you can still use VS Code to create notebooks:

A quick look did tell me that some of these will have different options for the code cells, including SQL, as part of those notebooks. But I haven’t had time to dig into it more. What this does tell me is that the way that you break out notebooks in VS Code may be a little more complex than what we are working with currently in Azure Data Studio. I’m not sure what the implications of that are yet, but it will be interesting to see where that goes in the future.
As you can see, there is a lot to play with here. Doing some quick searches shows some more videos and other tutorials on this topic pop up so I’m looking forward to seeing and reading more of those as well. The reason that I’m excited for this is that I can see some of the cool possibilities as to what this means for developers and how we can all take advantage of what notebooks have to offer.
So I guess we all have another tool we need to add to our kits….