>> Recently, some new additions for
KQL in Azure Data Studio have arrived.
Come learn with me from Julie in
this week's episode of Data Exposed.
[MUSIC]
>> Hi, I'm Anna Hoffman,
and welcome to this episode of Data Exposed.
Today, I'm joined by Julie,
a Program Manager on the Azure Data team.
Thanks for joining us today, Julie.
>> Hi, Anna, thank you for having me.
I'm super excited to be here.
>> Awesome. We are super excited to have you here.
Today, we're going to be talking about KQL in Azure Data Studio,
and I'm really excited to see because you guys are
always working on really cool stuff in Azure Data Studio,
but before we get intro, I wanted to ask you,
why do you think KQL in
Azure Data Studio is important and how does
KQL relate to our Azure SQL and
SQL Server deployments that we're very familiar with here?
>> Right. As you may already know, Anna,
my team builds Azure Data Studio
to deliver modern data experiences for data professionals,
so any professionals using data today.
Now, earlier this year, we did a number of
research including talking to XML customers,
for example, Azure SQL DB customers,
as well as internal software engineers at Microsoft.
Now, it turned out that they actually are using KQL or
Kusto Query Language already today to
analyze these massive real-time streaming data.
Now, this could be event logs or telemetry even.
Now, as you may already know,
Azure SQL DB today also captures the telemetry
or even logs that can be connected straight
to Azure Log Analytics.
So if you use KQL,
you can connect to Azure Data Explorer
as well as Azure Log Analytics as an example and
do this data science magic or even
sometimes troubleshooting too for your products and services.
>> Awesome, cool. It seems like this is something that's very
common among our customers
for analyzing telemetry and doing other things,
and you guys bring it into Azure Data Studio.
My guess is it's going to get really cool,
we're going to be able to know book stuff.
I'd love to take a look if you have some study to show us.
>> Yeah, absolutely.
Just a quick reminder,
I mentioned a little bit about modern data experiences.
So in Azure Data Studio,
we have the benefits of
syntax highlighting and all this good stuff,
it's cross-platform, and you can even
connect to Git source control.
So if you have Notebooks,
you have files like SQL or KQL files,
you can also do all these nice version controlling.
So yeah, let's get started with the demo, shall we?
>> Yeah, let's do it.
>> All right. Okay. What I have on the screen here is KQL magic.
So today, I'm going to show you the first part is
KQL magic in Python Notebook in Azure Data Studio.
Here, I'm already connected to Python 3 and
I've already loaded KQL magic here.
Now, the interesting story about this
is that this Notebook actually was run
by somebody else and they just shared it with me.
With the benefits of Notebooks,
I don't have to rerun it if I don't want to.
Yeah, this is what you get.
All right. Now, let's talk about KQL magic.
Once you load or install the KQL magic in your Python environment,
you should be able to start writing
your KQL queries with the prefix percentage KQL like this.
So when you run it, you'll get the results like this.
You can do even visualization.
Here's an example.
Let me quickly configure this.
Let's see, vertical and then close this.
Now, you have Notebook with the result set visualized.
Because this is running on Python,
you could also render the time chart
and it's actually using Plotly in the back-end.
So if you're already familiar with
Python and you're using KQL magic,
it should be super easy for you to get started.
So as an example here,
I can zoom in that will
show the interactivity from the Plotly aspect.
>> Very cool.
>> Yeah. Of course,
if you're using Python already and you want
to do additional, I don't know,
messaging or programming on top of this dataset,
you can do that too.
So that's the first part of KQL magic.
>> Awesome, really cool.
Now, I think you also mentioned there was some extension
I could use or make it even easier to use.
>> Right. Earlier, I mentioned about we had a research.
When we talked to this number of users,
we have a lot of users who come from KQL
and just really want to have the benefits
of the goodness that we have in SQL
today in Azure Data Studio applied to KQL.
So then we've decided how about we bring
native Kusto experience to Azure Data Studio.
Simply, to get started, if you download
these September release of Azure Data Studio,
you should be able to search
an extension from the extension gallery.
You can type in Kusto,
so I actually already have one here,
and it will show the Kusto extension.
Now, since I've already got it installed,
I don't have to install it anymore.
But once you install it,
you should be able to get that native KQL experience.
Let me show you what happens then. Here's an example.
Say you've already installed the Kusto KQL extension,
now you can create a new connection.
So as an example,
I've got one here where it's ADX or
Azure Data Explorer help cluster
that you can connect to the help Kusto Windows.net,
which is actually free for everyone to try out
if you already have Azure Active Directory account.
Now, if you check out here the connection type,
you have Azure Data Explorer.
Just remember that to change it to Azure Data Explorer Kusto.
Since I've already got it connected,
I'm just going to cancel out of that.
So once you're connected,
you should be able to see it on
your connections fullit or Object Explorer,
and you should be able to see
the cluster as well as the databases.
I only have one, so it's only going to show one here.
Then you can browse the functions or the tables.
Yeah, it's pretty user-friendly from that perspective.
>> Wow, very cool.
>> Yeah. Now, that's a basic from the SQL world,
generally speaking, you can right-click and do a lot of actions.
So let's do that here for one of the tables.
Let's right-click on the StormEvents
table and then click ''Take 10''.
Now, it simply brings up a new KQL file
that will just run the StormEvents and then do a Take 10 on it,
so just showing the top 10 rows really.
It's pretty simple and straightforward.
Let me show you another example of my Kusto
or my KQL query here.
So this is one that I have prepared earlier.
You can write a little bit more complex query and
then you can also use SandDance to visualize these data.
So here's one that I have prepared earlier.
Let me minimize this. Isn't that cool?
>> Now, it's really cool.
You can basically bring in your data and then add visualizations.
I know SandDance is super easy to work with,
so that's really cool.
>> Great. Now, let me show you a native Kusto Notebook then.
I think you'll love this Anna because I know you've
probably work quite a bit with Notebooks.
Here we go. All right.
So I've got one that I've created earlier.
Now, obviously, I can change the connection here.
So as an example,
I can connect to the samples DB.
Let's do that. Make sure that we're connected.
I think we're already connected,
so let's give it a go.
Let's see. So from a Notebook like this,
you can simply add a Kusto.
You can start typing in StormEvents.
So if you noticed earlier,
it actually bring really nice syntax
or IntelliSense rather, for you.
That way, you don't have to remember a lot of things.
It increases the productivity.
Here's, again, the top 10 rows again
query that you can write and here's another example,
where you can write the StormEvents aggregation.
Because of the charting capability inside Notebook today,
you could also do this visualization of the dataset.
Let me just format it a little bit,
and this Notebook is ready to go and chart with other people.
>> Awesome.
>> Yeah. Lastly, I know this is your area Anna,
I'm sure you will love this.
Let me just go to this Notebook,
Machine Learning in Azure Data Explorer.
So this is a little bit advance.
Some of you may already know that there is
a Machine Learning or Machine Learning plugins rather.
There's more than one plugin for Azure Data Explorer.
So if you're in that advanced level of KQL,
you can just write this advance query using
Machine Learning inside Azure Data Studio in
a Notebook and you can share this Notebook with
other people and they'll be able to see
the query as well as the results.
>> Wow, that's really cool.
So if we wrap up all the things that you showed to us,
because I feel like they incrementally
got more and more exciting to me,
the first you showed us is how we can do KQL magic in Python.
Really cool, really great for
people already familiar with working with Python,
and then we get that Notebook experience.
Then you brought in this KQL extension,
which is really cool because it's going to allow us to browse
the folder hierarchy just like we would in Azure AQL database
in Azure Data Studio,
but now with an Azure Data Explorer cluster,
so that's really cool, and on top of that,
that's going to bring us native KQL Notebooks.
Even better, I don't have to worry about the KQL magic,
I can just write KQL and connect to my cluster.
Finally, do Machine Learning on top of that.
So really awesome stuff.
This has been really cool for me to see.
I'm excited to start playing with this.
Julie, for our viewers as they go and get started with this,
what's one tip or piece of advice that you might have?
>> Yeah. It's quite interesting because I come from the SQL world.
When I saw the KQL for the first time,
I was pretty scared of it.
But the good news is
the documentations are actually really, really good.
There's even like a SQL to KQL translations.
So if you're coming from SQL,
you can learn KQL really quickly,
and there are lots of samples including the ones
from Azure Data Studio documentation.
It has the KQL magic example as well as the native Kusto one,
so go check that out.
>> Awesome. Well, thanks so
much for being on the show today, Julie.
Thanks for our viewers for watching.
We're going to put some links in the
description for you to go learn more
and try this out and get the KQL extension,
and we hope to see you next time on Data Exposed.
[MUSIC]