Azure Command Line Tools

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with

Already have an account? Sign In »

23 hours 16 minutes
Video Transcription
Hello and welcome back to Cy Berries. Microsoft Azure Administrator A Z 103 course. I'm your instructor, Will Carlson. And this is Episode four as your command line tools.
So in today's video, we're gonna talk about the options that you have here within Azure for command line tools. And there are two of those two and 1/2. I would say we're gonna go ahead and set up the cloud shell within the azure portal so that we can do scripting within the portal without having to necessarily do any client site installs for this course.
And then we're going to spend a little bit of time talking about scripting and how that's gonna show up on the A Z 103 exam.
We're gonna get started today with a couple of slides, and
I want to call out again that there are two options for command lines in the azure ecosystem and the 1st 1 is gonna be the azure cli. This is gonna be based on the bash command line tool. So if you're familiar with Lennox or you come from that side of the fence,
this is gonna be the tool. It's most familiar to you.
There's also power show, which is clearly a Microsoft product has been involved in included in windows for quite some time now. And there are some. There is some work being done recently that makes power shell a cross platform products as well.
The Azure or ese cli has already cross platform. So ultimately, both of these tools were work on Windows Lennox or Mac Os. So you can really choose which one you want to use. If you would like to use power shell on Lennox or in Mac OS,
just be sure to look for and download. As of right now,
how are Shell Corps from? Get up
now, the tool that we're gonna be using here for this course because its deployment is the simplest and the quickest is going to be cloud shell and cloud shell is simply a command line that's present within the azure portal.
And you have the option in that cloud shell thankfully, to be able to use as your CLI or power shell, whichever one you would choose.
And we're gonna stick to power shell in this course just for consistency sake. But I recommend that you follow along, as mentioned in the supplemental material episode with the commands in Azure cli. So again, if we're doing it with the gooey in portal,
you should ultimately know or be familiar with how to do it in Power Shell
and an azure CLI.
Now, if that's completely scared you off,
let's talk a little bit about how scripting is going to show up on a Z one of three now. First of all, a little bit of the bad news is that,
as you see Elias Fair Game in the exam, Power Shell is also fair game in the exam and some of you right now, maybe crying foul at Microsoft for having us be familiar with two scripting engines in a Z 123
I don't necessarily disagree with you. I applaud Microsoft for giving us choice in using the command line tool that we're most familiar with. But it is a little bit interesting that we have to be familiar for with the exam with both command line tools.
But like it or not, that's the way the exam is going to be Now. There are some helpful ways to survive scripting on the A Z one of three exam. So let's go through those and give ourselves a little bit of hope here. Right?
So in the azure sea, Ally, the pattern four commands is going to be
the letters ese
plus a noun or the object that you're going to be interacting with, and then the verb meaning what you're gonna be doing on that object. So, for example, here
ese VM list calls the azure CLI command with a Z,
we're going to be interacting with a V M. And our command is to list them all a Z V m list. That's pretty simple, right?
And the command follows along for a number of
consistent verbs across across the gamut here. So list create and delete are going to be verbs that you see a lot regardless of the object that those air being done on and those should be pretty self evident as to what they do. But to further the example, we could do a Z group
list and
now we're listing resource groups.
We can do this command to create a new group and this command to delete a group. Now, obviously there are going to be switches or other options put in these commands to make them operate because just a Z group create wouldn't give the command line any information about the group that you wanted to create. But
this is the gist of the commands for ese cli
a Z plus the object plus what you want to do with it
now to counterpoint that with power shell,
the pattern is a little bit different.
Her power shell. It's going to be a verb Plus now. So to do the examples for the A C C ally over here on the power shell side, it's gonna be get a Z V M.
Now, one thing I'm gonna call your attention to as you're looking for documentation online, you will see as your R m. So instead of get a C v m, you would see get azure R M B M and
Azure R M is the older version of the power shell module for azure.
You'll see it more heavily, and documentation you most likely at this point will not be installing. The azure are in module. It's not the current module you'd liketo installed the azure tools for power shell. Make sure to install the ese module.
But having said that, the current command for listing all of the virtual machines in my past your account for power shell would be get a ZPM.
New creates a new one. Remove removes of'em. Same thing here for groups yet Resource Group New Resource Group Remove Resource Group
so you can see the terminology is a little bit different. It's very consistent for virtual machines, but it's different between groups and resource groups here in power ***.
Now, if you would like to install the azure CLI on your own machine, interact with that. As a client installed, you can download the M S I installer for the azure CLI. It's really simple. Just Google it. It will be towards the top of the list.
You can also find documentation on how to download and install the ese module for power show. We're going to take a different approach here for this course again because it's very simple and straightforward. We're going to use the Cloud show
now to get cloud show all set up. We're going to log in to our azure portal at portal dot azure dot com, and we're going to click this somewhat nondescript button up here at the top.
This is the cloud shell button.
Now, because this is the first time that we've set up a cloud shell, we're going to be prompted to create a storage account. And this is gonna be for saving any scripts that you would like to save or any files that you want to write to disco output that you would like to write to disk. Obviously,
it has to have somewhere to be written to.
And as you're writing commands, you go that all has to have somewhere to live. That's gonna need a storage account so you can select the subscription that you want to put that storage account in, and you just click create storage
and you can see that cloud shell. That storage account for cloud chill is being has been created. And now cloud shell is initializing
and once your cloud shell is all initialize, you're ready to go. This should be very familiar. We're looking at a command line right here in portal. Now, just for the sake of illustration weaken do ese bm list.
And that's gonna show us all the V EMS currently in our azure tenant
now, Something to be mindful of is you've opted for the client side install of ese cli or the ese power shall modules is you're gonna have to connect your
command line Tool in tow. Azure. You're gonna have to log in. So
be prepared for that. Depending on the tool that you're using will depend on how that process works. But I call your attention to that more to point out the fact that because we're using the cloud shell tool, I do not have to log in. Obviously, we're already logged in here.
Another thing that's interesting about Cloud Shell, in addition to its ease of setup, is I can simply click over here.
And it did confirm
to Power Shell. I don't have to install both tools, but I can use whatever tool I want right here in Portal.
This is gonna be important, I believe, as you're going through in preparing for the easy one of three exam again because I highly recommend you keep up with the commands both in Power shell and in ese cli.
And again just to prove the point here, I can go ahead and type get a Z B M and Power Shell, and it has listed all of the virtual machines in this tenant.
And that's all there is to using command line tools here within portal.
So in today's video, we talked about the two command line tools available for Azure, both ese or azure CLI and power shell. Using the ese module as the current module
we talked about. We talked about a little bit about how you can install those tools on your own machine. Be an azure sea ally or power shell. There's documentation on line to walk you through How to do that? That is very good,
but I recommend you use Power shell for this course. It really is quite simple, and you can switch between both tools right within portal.
Yes, unfortunately, like it or not, we do have to be familiar with both. Scripting language is for a Z 103
where there are some patterns that we can follow that simplifies our live here as well. The other thing that I'll call out to you before we move on and close for today in this episode is that you will not be creating command line commands from scratch on the A Z 103 exam.
Most likely, what you're going to see on the exam is a fully fleshed out command with two or three things that are missing. And what you're gonna have to do with those blanks essentially is fill them in either from a a dragon drop sort of question. Or
each of those blanks will have a drop down with multiple choice.
The devil in the details here is that there's three blanks to fill in, and if you get all of them right, but one, you still don't get any points for that question. So you will not know how to create commands from scratch. But you should be familiar enough with the commands to know what goes where. If you have the bulk of the command written for you
coming up next, we're going to actually get our hands in an example of scripting in cloud shell so that you can become a little more familiar with the command line switches and the way to command work and variable assignments in scripting tools for azure.
Thank you so much for joining me today, and I'm looking forward to the next episode
Up Next
AZ-103 Microsoft Azure Administrator

This Microsoft Azure AZ-103 Certification training course teaches students to perform tasks like managing Azure subscriptions and resources, implementing and managing storage, deploying and managing virtual machines (VM) and networks, and managing identities!

Instructed By