bonjour hi welcome to another video of cloud in five minutes I'm Frank Boucher
and today I want to show you how to search like a bus with Azure graph query
would it be with Azure PowerShell or a sure CLI we all do bunch of queries
across our subscriptions to get information about our resources and with
time we know we have more and more subscriptions what's nice about Azure
graph is you could query across all subscription at once it's not only very
performant but it's also very useful if you want to know more about the
performance I invite you to look this awesome post from my friend Stephan
Lapointe with Azure MVP I will put the link in the description and explain how
quickly it could be compared to the old-fashioned way
so now let's get started so today I want to use Azure graph query and you could
run it directly from the cloud shell or from a terminal it will also be possible
to run it on PowerShell CLI but for today I will be an azure CLI to get
started you could follow the link I create just for you
aka EMS /az graph - q4 query there you have all the information to get started
so let's first add the extension right now the extension is in preview so by
default it shouldn't be include in your solution to add it is just easy
extension add and then you specify the name of the extension so resource graph
to see that the extension is already installed you could so you could also
list them all with easy extension list and of course to remove it it will be
easy extension remove then you pass the name of the extension but let's keep it
for a little while so we could check try it
so now we'll clean my string and try our first query like I was saying with Azure
graph you could query across all your subscription at once but of course you
could also specify only a subset to know all the particularity of what's possible
you could execute the comment as your graph query with L now you have all the
information I promised you a first query so let's do it so it would be easy graph
query and then I specify my query so I'm on the project names and type that's it
like executed and now I have everything in a JSON format it may be different
because the default format is part of the setting so you may have changed your
own settings but you could also change it on the fly so for example I can
change the result the output I can change the output of my result by doing
that so I still have the same beginning whoa
so I still have the same beginning with AZ graph query and then I say project
that's my object that is written and I say I want the name with uppercase and
the type and then I want that in a table format I could have different tab
separated value and different type but for now let's try with a table so now
it's more human readable you prefer having your results sorted I understand
that you just need to specify the sort by and you have ascending descendant
possible great that's cool so of course you will be probably
working with a bigger that I said that I am right now
so it will be important to page your result because the maximum record
returned is 5,000 so to do that you could just specify to return a quantity
so let's say I want to have the tenth first record so there it is and if I
want a page let's say my page is let's say my pages - so if I skip if I skip to
then I will start at server farms there it is
of course custo that's the name of the quarry language support many where
condition reg X and multiple stuff this video was just an introduction so if you
want to learn more go to the URL to learn more about it and it's worth your
time because this is the same language used for querying in analytics that's it
for this introduction video I hope you liked it and I hope it will be useful if
you have questions or topic you want me to cover write it down in the comment
section I'm always very happy to read you until then
see you next time thank you for watching you