>> You've probably heard about Notebooks by now,
but what you might not know is
that you can run PowerShell in them.
Anna is here to show us how today on Data Exposed.
[MUSIC].
>> Hi and welcome to another episode of Data Exposed.
I'm your host Jeroen and today
I have Anna here with me. Welcome back.
>> Thanks.
>> We're going to talk about Notebooks.
You've probably heard about Notebooks by now,
but you might not know that Notebooks are actually
also available in Azure Data Studio, aren't they?
>> That's correct.
>> Cool. So what can I do with that?
>> Yeah. So we've been talking a lot here about SQL Notebooks,
and there was this great big idea
because we've brought what was previously
only something for data science really and
brought it to data engineers and
DBAs that can use these SQL Notebooks.
So you might have seen this capability
of a SQL Kernel here in a Notebook,
and what a Notebook basically allows you to do
is intertwine text and runnable cells.
>> Right.
>> Then you can save the results of
those cells and maybe send off if you're doing
troubleshooting or send as even like tutorials or
anything like that to see what
your results should be or any issues that you're having.
So we've had people loving
these SQL Notebooks, what else can we do?
>> Okay.
>> So recently we came up with this PowerShell Kernel,
and that PowerShell Kernel as you
can see allows me to connect to local.
So I'm using PowerShell to connect to my local host.
So basically it's like running the terminal locally
except I can save the results and intertwined text instance.
>> Right. So you can save this in the Notebook, make some notes,
show the results, send it to me like, "Hey,
this is the expected result."
So I can reproduce and those things.
>> Exactly.
>> That I can just use it for PowerShell as well.
Cool. So that's great.
So I can run any PowerShell in here?
>> Yeah. That's what I wanted to show today is how you can get set
up for the Azure module that's available for PowerShell.
You can also use the Azure CLI but today we'll show
the Azure PowerShell module.
>> Okay, cool.
>> So this first step is just to check the version that you have.
For PowerShell users, there should be a very common thing to see.
Note that you need a 5.1 or higher to
use the latest Az module for a PowerShell.
Then I can just go ahead and install that and force it.
Hopefully this doesn't take a long time,
otherwise we'll cut through it.
>> So you're just now installing
the Azure module for PowerShell, right?
>> Yes.
>> Cool.
>> So now that's installed,
I can then confirm and get the version.
You should be able to replicate this on
your machine and just be all set up to go.
So now I see what Az module I'm running,
and I can connect to my AzAccount,
and my subscription, and information,
and then I can start going.
>> Cool. So that's great.
So this Notebooks are amazing with all the texts,
and the code, and results, great.
But what if I need to run something
more interactive? How do I do that?
>> Sure. Sometimes you do need to
run more interactive that needs a yes
or other things that you don't just want to force it
through like we do using Notebooks sometimes.
What you can do here is you can actually
create a integrated terminal
and run Azure PowerShell
or any PowerShell type of commands from there.
You might have seen this before,
but if you select Ctrl, Shift,
P, that's this nice help bar that gets you access to everything.
If you're familiar with VS code, you've seen this.
But you can see then you can start searching for things,
and you can see the first one is one I've done recently,
is to create a new integrated terminal.
So by doing that,
now I get a terminal running PowerShell.
So I can start doing just the normal PowerShell so if I do.
>> Perfect. So next to your Notebook you're not just using
the terminal to do interactive stuff.
>> Exactly.
>> You're not even leaving the application, right?
You just still in the same app.
>> Yeah, exactly.
>> Cool.
>> It's really nice and easy to use.
>> So if you want to learn a little bit more,
look at how I get started,
is there anything you can point us to?
>> Yeah. So we will share a link to this set of resources,
and here in this set of resources
you can see things like how to do things
specific to Azure SQL using that SQL module in PowerShell.
So we have things about configuring failover groups,
things for single databases and elastic pools,
and we even have commands that are specific to manage instance.
So this can be a really useful tool and
hopefully we've given you something to get started with.
>> Cool. Well, thanks again Anna,
and thank you for watching.
Please like, subscribe, and leave
a comment and hope to see you next time on Data Exposed.
[MUSIC]