Azure CLI for Beginners: The Complete Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's going on guys on this video I wanted to teach you guys how to use the azure CLI and if you don't know what the Ezra CLI is it's the command-line interface for managing as your resources so anything you can do in the azure console you can also do through the command line interface and so in this video we're gonna I'm gonna walk you through how to set up an azure account I'm gonna show you guys how to set up and install as your CLI and that's gonna be on Windows Mac and Linux and from there you know we'll start playing around with creating modifying and deleting virtual machines as well as resource groups and I think that'll be a good starting point for you guys and so from there you know you guys can kind of you know just take a look at the documentation and you'll see that you know everything that I've covered in this video it's going to apply for you know managing any other service or resource within Azure and really all I want to do in this video is just to kind of get you started on how to work with the CLI and just really go over some of the basics and hopefully you know in the future you guys start to use the edge or CLI more and more I think it's a lot more efficient than using the console so hopefully you guys enjoy this video if you guys want me to cover any other topics with regards to Azure or as your CLI or even AWS or anything related to the cloud I just let me know leave a comment down below and I'll try to make a video on whatever type of you guys requests gonna walk you guys through how to set up an Azure account and so the first thing that we have to do is just go to Google and just search for Microsoft Azure should be the first link that you can find and so the exact link is Asher Microsoft comm /en - us although that part just gets appended because I'm located in the US and we can just click on free account and start for free you and it's going to ask us to create a Microsoft account and so we can just create a new one if you don't have one or you can just log in if you do have one I and so I don't have one so I'm just gonna create a new one and we can call this anything that we want I'm just gonna call this and then once you get that hit next you're gonna have to create a password for yourself and it's going to send a verification email to the email that you provided so just grab that verification code and enter it in here you and it's gonna ask some basic information about yourself like your name your poly gonna have to include your phone number as well as a looks like we have to provide an identity verification card but we'll go through this step-by-step and I'll make sure you guys understand everything that you need to do to get your account set up you and so here we're going to verify by phone number so we can ask them to either send a text message or a phone call I'm sure it's like text message and then we have to put in our verification code and once that's done we can just hit verify code okay and you will need to put in a credit card so even though it's a free account you know start using too many resources they will bill you so you will need to enter that information in but just keep in mind as long as you delete your resources you know once you're done using them you really shouldn't be charged anything and at most you may get charged just a you know just a couple cents or less than a dollar at most you all right at that point it should take us to this page which means our account was created successfully and let's see now let's log back in so to actually access your Azure dashboard you'll see this button right here at the top is just says portal you select that that's going to take us to our as your dashboard and it's gonna ask you if you want to take a tour but we'll just say maybe later and so there you go guys you've now set up a Azure account and at this point you know you can start creating virtual machines and you can start playing around with it to install as your Celia on a Windows machine let's navigate to the azure sea light documentation and so we can just search for as your CLI and it should be the first link and here we'll just do install on Windows and we can just download the MSI installer so this will set up everything for us we won't have to do anything else make sure you accept the terms in the license agreement and you may get this pop-up just hit yes okay and so once that's complete just hit finish and now we want to verify that be successfully installed as you like so we'll open up our command prompt and here let's try logging into Azure and the way you log into as you're using the CLI is - and AZ login so hit enter it'll take a few seconds and you should ideally see a pop up I'm asking you to enter in your credentials so that you can login and so just select your default browser now I can put my username in and enter in my password all right and we should see this message saying you logged in successfully and if we go back to our command line you should see an output like this so that means that we have successfully logged in and we verify that our as your CLI has been set up properly to set up as your CLI on a Mac machine we want to navigate to the azure documentation so we'll search for Azure CLI and we'll click on the first link and so this is going to provide us without you know step-by-step instructions for installing as your CLI and we want to select install on Mac OS and to install as your CLI on Mac it recommends that we use a tool called homebrew and you know homebrew is something I recommend that you have installed whether you want to use your additive CLI or not because so many applications rely on using homebrew to get it installed on Mac so you don't have it definitely install it I'll walk you through how to do that in a second so let's go ahead and install homebrew let me open up a new window and just we want to just search for homebrew and select the first link and all we have to do to install homebrew is just to copy this command and let's go to our terminal and just paste it in and it'll ask us for our password you you and then we need to hit enter to continue with the installation so this is going to be a decently long process I may take like five to ten minutes so I'll pause the video for now and I'll touch base with you guys once it's complete you okay so it looks like we have finished installing brooo and at this point we have access to all of the brew commands so if we go back to the documentation you'll see that to install as your CLI we just have one command that we need to run so we can just copy this we'll go back to our command line and just paste that in you now that the installations complete let's test to make sure that our as your CLI was installed properly and so we can do that by running our first command which is going to be a Z login so this is going to login to Azure for us so that you know moving forward whenever we run any commands the address Eli will use those credentials to perform whatever action that we're trying to accomplish so we'll do that we'll hit enter and just give it a few seconds it'll pop open a new window or browser and here we can enter in our credentials it next we'll have to put in our password as well and you should see this message that's saying that you have logged into Microsoft Azure so at that point we're good to go we can close out our web browser if you go back to the command line you should see an output that looks like this saying that you logged in it's gonna include some information about the user that you've logged in as and so at this point you're good to go guys you can start running whatever commands you want and start playing around with the azure CLI and you'll get you know lots of chances to you know learn a lot more about the edges UI in the upcoming videos all right guys I'm gonna walk you through how to set up as your CLI on a Linux machine so let's open up our web browser and we'll go to the documentation to see how we can do that and so we'll just search for as your CLI just like the first link and so now you'll see all of the different options we have for installation and what operating systems that support and so I'm running a a bunting machine so I'm gonna select this one however if you're running you know Red Hat or scent OS or any other flavor of Linux make sure you just select the right link and you'll see that it's really easy to setup and install as your CLI on a Linux machine all we have to do is just copy this one command and just paste it into our terminal going to do everything for us so all we have to do is just put in our pseudo password all right so now that it's complete let's run our fresh command we're gonna type in AZ login so this is going to login into Azure and we should see Firefox or whatever your web browser is pop open a window and you'll see that it's going to request us to put in our credentials you and once we enter those in you should see saying that you have logged in successfully into Microsoft Azure and if you move back to our command line you should also see something similar saying that you've logged in successfully and it's gonna include some information about our user as well and so at this point you can start running as your commands as you are logged in and it's going to use those credentials that you entered in whenever you try to create or delete or modify any resources within your Azure environment now that we've set up our as your CLI I think now's a good time to start playing around with the CLI itself and start deploying and managing resources with the CLI and I think the best way to actually explain how to use the CLI is to first show you how to you know create a virtual machine using the console which most likely you guys already know how to do but I think it's important for me to walk you through it you know just one more time just so that we can really see what are some of the things that we have to you know input into the console to actually deploy a virtual machine and then I can show you how all of those same you know details and information are necessary when we create a virtual machine through the CLI so open up the console if you haven't already done so and we'll just deploy a AB unto virtual machine and I'll show you how easy it is within the console and then we'll do the same thing within the CLI as well so here we'll just hit add and at this point you'll see that it's going to default to your default subscription so you can leave that alone but you'll see that it's required to have a resource group any time you want to create really anything within azure right so a virtual machine Avena they all have to be associated with the resource group and if you don't know what a resource group it's just a way to kind of group related resources within your Azure environment and so you know it is required to have that if you are going to create a virtual machine and if this is a brand new account most likely you don't have a resource group and you can just verify that by hitting the drop-down so if you had any you could always select that so it looks like it does ship with a default resource group however if you wanted to create a new one you can always hit create new right here and it's gonna walk you through that but you know instead of doing that through this short-handed window let's go back to the home page and let's manually create one so you can always click on resource groups or you can search for that service itself so just search for resource groups and select that and we can just hit add here and leave that as the default and here just give it a name so I'm just gonna call this RG one for Resource Group one and then we'll just hit review and create and that's been created so if we hit refresh well it looks like it hasn't created yet so it's gonna take some time okay so now we can see that a new research group was created so let's go back to our home page and let's create our virtual machine now go to add again and now we can select our new research group that we just created and so I you know the reason I'm showing you all of this is that you know when we go to create a virtual machine within the CLI guess what we'll have to pass in a resource group just like we did in here so it's important to understand you know what are the requirements for deploying a virtual machine and now we have to give it a name so I'm just gonna call this VM will call this I'm just gonna call this test VM region you could specify what region you want to deploy to so I'm going to use US East one if you want to follow along just select the same thing or if you don't you know just go ahead and select whatever region is geographically closest to you and we'll ignore availability option then we have to select an image so you can see mine defaulted to a bunch a server 18.04 LTS which is the one I wanted however feel free to select any one of these this is just for learning purposes then we have to specify a size so we can you know hit the drop-down or we can just select a size and you know since we're just doing this for learning purposes just select whatever is cheapest I think this is the cheaper one because it's just one virtual CPU one Ram only two data disks very very low I ops and temporary storage is just four gigs so we'll select that now for authentication there's two different ways to authenticate on a device we can either use you know keys you know SSH keys or we can just use the traditional username and password so for simplicity sake I'm going to change this to password so that we don't have to worry about you know figuring out how to set up the keys and things like that but just keep in mind that this is something that you do have to setup when you are creating a virtual machine you have to specify whether you want to use the traditional password or keys so I'm gonna specify a user I'm just going to call it a Sanjeev one two three password and just pick any password and you know as you're going to have some requirements like it's got to be like 10 characters there's got to be you know at least one non alphanumeric character and things like that then leave the inbound ports as default so we're gonna allow SSH that we can actually connect to it we can hit next go to disk so we can leave all of these as default networking leave all of that as default management so here it looks like we have to provide a storage account so we'll just feed a new one and just give it a name so I'm just gonna call this energy storage and I don't know why that's giving me an error already taken really all right all of these are taken no way only lowercase letters oh well that's a problem all of those numbers okay we've created that we'll go to the advanced page ignore all of those we can assign a tag here if we want but for now we'll skip that and then here we'll just review all of the information that we just provided and once we verify that everything looks good we can hit create all right so as you're going to work on deploying this virtual machine it's gonna take a couple of minutes so Azure tends to be a little slow especially you know compared to like AWS so let's go back to the home page we can hit virtual machines and we can just keep hitting refresh for a bit and it's probably gonna take a while so I'll pause this video and touch base with you guys once that's done all right so it looks like VM it looks like Asher has successfully deployed our VM so we can see that it's in a running State and if we click on this we can start to see some more information regarding this VM and it looks like it was assigned a public address so we should be able to actually SSH to this machine and connect to it since it's in a running state so we'll copy this and then from your command line and so you know regardless of whether you're on a you know a Windows computer or a Mac or Linux the commands should you know be the same regardless so to do SSH then the user name that you provided for that virtual machine so mine was saying chief 1-2-3 and we'll do at paste that in you're gonna get this fingerprint warning just hit yes and then now put in the password that you specified all right so now there you go guys we've successfully logged virtual machine that was deployed on Azure and so that's how we do it through the through the console and so now I'm gonna walk you through how to you know do the same tasks on the azure CLI and you'll see that it's really simple through the sea light it's actually a little bit quicker especially once you start to get more familiar with the different options and parameters that you can pass in so to exit out of this just type in exit and that's going to take you back to your local machine now that we've successfully deployed a virtual machine through the azure console and successfully connected to it I think the next step is now to show you guys how to do this through the azure CLI and you know just to before we and before we get started make sure that you've logged in by doing an AZ login and also you know if you're gonna follow along with me I recommend you pull up the azure CLI documentation and just go down to the references section so this is what I'm going to continually reference because all the information that you'll need regarding you know what commands what options what flags that we have for each different as your CLI command it's all gonna be listed out here and I think azure does a pretty good job with documentation they usually do provide a solid amount of examples for each one of these commands so it'll give you a good starting point if you don't know what you're doing but anyways you know we want to create a virtual machine through the CLI just like we did with the console and it makes sense to just kind of scroll down and just see you know what section we might be interested in to do that and so there is a section called virtual machines and that's probably what we want so we'll click that and then you'll see all the different options that you have under the virtual machine section but before we actually start taking a look at those let's go to the CLI and I want to show you guys how you can use the help flag for any azure command that you're trying to run so if you type in AZ and you'll know that basically any command that you run on the azure CLI is always gonna start with AZ that's how you use the address you like you can do the - - help and it's going to show you all of the commands that you have at your disposal and so we can just scroll up you can see all of the different services that we can work with and you know obviously we're mainly concerned with the VM so that's gonna be managing Linux or Windows virtual machines and if you go to the overview under the virtual machine section you'll see that they all start with VM so anytime you're working the virtual machines you're gonna do a z vm and then you know some sub command but if we do at AZ vm and then a - - help it's gonna show you what commands we have within the vm sub command so these are all of the commands and then we also have some subgroups as well and if you just scroll down if we're trying to create a virtual machine I you know there's obviously one called create that's probably what we and you can see based off the description that creates a Azure virtual machine so this is definitely what we want and if we go and do an AZ VM create and then - - help it's gonna show us all of the flags and options that we have so you can see there's there's a ton of documentation about that so if you never or if you ever can't remember you know what options are available for a specific supplement you can always do the - - help or you can always just go back to the documentation now usually prefer going back to the documentation because it's a little easier to read but let's go to the create section and let's take a look at you know what we can do to create an azure virtual machine and so you'll see we do a Z VM create and we have to give it a name as well as a resource group right so we had to do that in the console as well right we had to give it a name and we had to specify what resource group it should be associated with as well as what image we're going to use and so you know just like it was with the console the CLI is gonna be exactly the same the same you know the same information that we pry it and provided into the console we're gonna have to pass into the CLI as well and if we scroll down a little bit more into the documentation you'll see what the required parameters are so at the bare minimum we have to give it a name and we have to give it a resource group and you know before we actually start creating a virtual machine you know since we did create a resource group through the console and we could use that resource group I think it'd be cool for me to show you guys how to do through the CLI just so that we kind of have parity between you know what we did with the console as well as what we did with the CLI so let's scroll up and let's see if there's a section for resource group then there is so let's select that and then we probably want to go to the create section to create a resource group and looking at the documentation you know we do an AZ group b8 and you'll see that there's two parameters that we have to pass in so we have to give it a name obviously we also have to specify what location this resource group should be associated with if you don't know what these locations are these are just the different regions or data centers that Azure has so as your is gonna have a data center you know well there's gonna be a couple of different data centers in the US there's gonna be you know one in all the major countries and cities and so if you don't know what location you want to deploy this to you can always do a Z account list locations and it's going to spit out all of their data centers that we can use and so you know they've got one in Norway East Norway West Germany Switzerland so they're gonna have a lot of data centers when we deploy the virtual machine through the console I used a East us or us East whatever is called so I'm just gonna use the same one so if you want to follow along I just do us east um or just pick whichever one is geographically closest to you but let's see if I can find us on this list there we go East us so it's called East us not us East in Azure or AZ what is it called AZ group p8 Roop create and then we're gonna pass it the - al flag to specify the location and paste that nope that's not what I what was it called East us I think and then we have to give it a name so we can do the dash and flag right you can actually do - Ian or - G or - - resource group or - - name well whichever one you want let's give it a name so we already created one called our G - one I'll call this one art V - two and competing a research group is fairly quick so it's finished already and you can see the information about the research group it just created so we've got the ID we've got the location we've got the name we didn't specify any tags so that's set to null but if we go back to the console let's just verify that it got created and it looks like it didn't up there we go there's a little slow updating on the GUI so we got our g2 created and you know it's nice to see the list of resource groups on the console but we can also do that on the CLI so if we do a Z like it's Group list it should print out all of the different resource groups that we have so starting at the top we've got the one called network watcher RG which I think is the one that as your created for us by default but then we've got our g1 and then we've got our g2 and if you're wondering where I got that command there's obviously a list section under the resource group so that's going to show you what you can do to list out all of the resource groups that you have available in your Azure account and so now that we've got our resource group created let's go back down to the virtual machine section and let's see how we can create our first virtual machine using the azure CLI just go to create and just using the example here you can see that we do a zvm create we're gonna have to give it a name and have to give it a group and we're also gonna have to give it an image now within the GUI right we could always hit that drop-down to see all of the images that are available but the CLI it's gonna be a little bit different we actually have to run a specific command to see what images that are available if we do - - image and just search for the documentation on that go down a bit here so under the - - image like we can always do an AZ VM image list to see all of the images that we have available so let's do that and so you can see the different images that we have and so there's Windows server there's a whole bunch of them you know like 2016 2012 2019 then we've got a bun too so this is gonna be the one that we want and we can reference it by the you RN alias so up on - LTS but they've got you know an image for all the other flavors of Linux like Red Hat and Debian and you know cent OS but let's grab this a Bungie server so we want a bun - LTS just follow along with this guy just to create our first virtual machine so we'll do a zvm create passing the image flag and just paste a bun to LTS so we've got the image we're gonna have to give it a name and a resource group I'm just gonna call it vm1 and for the resource group we'll give it our G - - which is the resource group we created through the CLI and let's see what other flags we may need to pass in and so an important one is authentication type and if you remember from the section where we create a virtual machine using the console we had to specify if we wanted to use SSH keys or a traditional username / password and so this flag is essentially doing the same thing so you can specify if you want to use just as traditional password or if you want to use you know an ssh public key so we're gonna use the password section just so that we don't have to deal with the hassle of keys and so I don't have to kind of explain how that works because I'm not sure if you guys are familiar with how to set that up and how it works so we'll just stick to the traditional username and password and I'm going to copy this and we're going to set that to password okay and so when you set this to password you have to also pass in what the username is going to be as well as the admin password so let's pass in what our username is going to be and I'm gonna set that to Sanjeev one two three and I can pass in the password now or we can leave it blank and the azure CLI will actually just give us a prompt to enter it in after we run it so I'm gonna leave it blank and just let the prompt to handle it for us and that should be all the information we need to pass into the command to actually create our first VM so let's hit enter and let's see if that works you and I actually hit Endor too many times so I'm just gonna hit enter one more time it's gonna throw an error because I wasn't able to put in the password okay so once you enter in the password for your VM it should save running and so that means the as your Sheila is working on creating a virtual machine so this process takes a little bit a little bit of time on Azure I think you AWS tends to be a little bit quicker when it comes to deploying VM so I'm gonna pause the video for now and I'll touch base with you guys once that's done all right so it looks like it's completed and you know usually after it we create something using the as your CLI it's gonna give us some information about the resource that we've just created so we can see the ID this is the complete ID of the new virtual machine that it created that's gonna show us the region that we deployed it to the MAC address the current running state as well as the private IP and the public IP and if we go back to the console we can go back to the virtual machine section and we can just verify that it actually did get created so we'll hit refresh and there you go so there's VM one you know we can take a look and so all that information here is going to match up what with what's here now if you guys want to see all of the VMs that we have available what you do there through the CLI as well and the documentation there's a section called lists so we can do a zvm list you gonna list out all of the virtual machines that we have so starting at the top I think the first one where is it here we go the first one is going to be that test VM and then if we keep scrolling down see if I can find the second one yep the second one is virtual machine 1 and it's also gonna have some other information about it as well and you also have some other options with the AZ VM list so if you want to see a detailed output you can pass in a dash D you can specify a resource group as well if you want to see specific information about an individual VM we can go to the show section and do an AZ VM show and just pass in a resource group in a name and it's going to give us just information about that specific VM so let's try that passing the resource group of RG 2 and then the name is V M 1 and so this is just going to print out the information regarding that new VM that we just created so that's how you see information about an individual VM instead of having to do a list and then potentially parsing through you know a list of 50 different VMs alright guys so we've got a VM deployed let's just make sure that we can connect to it so let's go back to our virtual machines let's go to VM one and let's just grab its IP address and try to SSH to it so just like before you do SSH and you username and then at and then the IP address you'll get that fingerprint message so just hit yes and then put in your password and so now we've connected to our virtual machine so we can do an LS and our hostname CTL just to verify we are in fact running in a bun to machine around 18.04 for so that's nice and all but you know you know we've got a virtual machine deployed um let's say we want to modify something about this virtual machine and we could change a lot of things if you want to change the instance size so that you're using a more powerful virtual machine maybe one with more virtual CPUs or one with more memory we can do that through the command line or if you just want to do something simple like add tags then you can do that through the command line and I think that's what I'm going to show you guys how to do is a will update our our virtual machine by adding some extra tags just to show you guys how to modify a pre-existing resource within a sure so going back to the docs if we go to the virtual machine section there's a section called update so this is what we're going to want to use and you'll see that the way that this command works is you just do a zvm update and then you have to specify the name in the group and then you do - - set and then here we can set the tags however if you want to update some other aspect of it like you know what is the the disk or what is the resource group is associated with or the license type so you've got a lot of options when it comes to updating this virtual machine but right now we're just going to set a few tags so let's try to do that we'll do a Z VM Update and then we'll pass in - g4r g2 you and then we'll give it a name so or we have to give it the name of the VM so we'll do VM one then we do set tag or set and then we'll do tags dot and then here we're gonna provide the different tags that we want so I'm going to say we're gonna create a tag with a key of Department I'm gonna set that equal to let's say this is this VM is part of the accounting department and we can add as many tags as one so if you want to add an extra tag and we'll say this one is the owner and the owner of this VM can be some guy named mark all right so let's hit enter and let's wait for our VM to get updated and just to show you guys right now we shouldn't have any tags associated with this machine oh it looks like you just added it so it hasn't completed the command but it's already done it technically so let's just give it a few more seconds to finish all right and so once it completes its going to spit out some output regarding our virtual machine and you'll see the updated status show that we added the Department as well as the owner tag and if you check the GUI you'll see the same information all right so now we've successfully created a VM we've updated VM let's move on to stopping a VM you know that's an important skill to have you need to be able to start and stop your virtual machines and so if we go to our documentation you'll see that there's a stop section and this stop command is very similar to the update command you do in AZ VM stop you specify the resource group as well as the name of the VM so let's try that will do a z/vm stop and then - gee and we want resource group - and then the VM is going to be VM one all right so now that's complete let's just double-check to see that it got stopped so we'll go back to virtual machines we'll hit refresh and you'll see that it's now in a stop state however you may have noticed this little warning it gave us and it said that uh you know just because our machine is in a stopped state we will still continue to get billed as if it was powered on and that's just one of the quirks of azor is that you know when you stop it it's not really what you think it is so instead what you ideally want to do is actually deallocate the VM so what that means is that it will D allocate the resources the VM will still exist so that we can always power back on but when you d allocate you're basically no longer going to get billed for that virtual machine and that's usually what we want to do because that's why we stopped virtual machines so let's try D allocating this virtual machine and so if we go to deallocate we can do an AZ vm deallocate and keep in mind you don't actually have to stop at first and then deallocate you can go straight from running to the allocation and basically this command once again very similar to the other two commands you do a z vm deallocate then the resource group and then the name and at this point you're probably getting tired of having to continually put your resource group in especially well since we've only got one main resource group that we're working with so instead what we can actually do is we can pass in a default resource group so if we do a Z configure - - defaults and then specify our G - - as their default resource group will no longer have to pass in the resource group flag and it'll automatically know to use the default resource group so let's do that so that I'll have to keep entering that in you all right so now that our default research group has been set to our g2 if we go back up to the D allocation command all we have to do is just specify the VM we want to deallocate you and once that's complete let's just double-check on the console just to make sure that it got the allocated and so now our state isn't a stopped the allocated state which means we're no longer going to get billed for it all right so now we've got this powered down you probably want to know how to start it back up so you know just once again go to the documentation go to start and this command is exactly the same so a zvm start resource group and the name we set a default resource group so we won't have to pass that in however you know with this command there's another way of actually you know specifying which VM we want to start back up and so normally for commands we always did the dash G and then the dash n but with uh actually I'm on the update section oh no I'm not I'm on start but with the start to stop the update and all of these commands we actually have another way of specifying which resource we want to start or stop and that's using the dash dash IDs and then you could specify all of the IDS of the resources that you either want to stop start or update or deallocate and so we're gonna do that when you know when we want to start this back up just to show you guys that you know you could do it either way it's just a matter of preference so I'll do an AZ VM start - - IDs and now we have to get the ID of our virtual machine called vm1 so before we do that let's do an AZ VM and then show and let's do a - n and I'm gonna do vm1 and you may have to pass in a G flag if you didn't set the default resource group and so this is gonna give us detailed information regarding that virtual machine and we want to grab the ID property which is this massive string right here so just copy it from the path all the way to VM one and now we can do an AZ VM start - - IDs and then paste that ID in there moving back to the console let's just make sure he started back up now he's running as well so we've successfully created a VM updated it started it or stopped it the allocated it started the backup let's finally wrap things up by deleting it so moving back to the documentation we'll go to delete and then we just do an AZ VM delete and we can do either the dash G in the dash N or passing the IDs just do whatever you feel most comfortable with and we don't actually have to pass in the - chief I because I set the default resource group so I can just do - N and then BM one at this point it should have deleted our VM and now now we just have one VM left so we've now successfully deleted a VM to wrap this video up let's just go ahead and delete all of the rest of our resources just so that we don't get billed unnecessarily and the easiest way to do that well you know let's go ahead and delete test VM so we could do the same thing AZ a VM delete - ndm-1 and then just make sure you specify whatever resource group is under so this one's also under RG - - and I realize it's not called vm1 it's test VM and then once that's complete if we go to the resource group section we need to delete all of our resource group so we get our g1 and our g2 so let's make sure we delete both of those and while this is running let me just open up another terminal so that we can just perform those actions synchronously so we'll do well how do we delete a resource group we got to go up to the resource group section and then go to or delete there we go and so we just do a Z group delete and then the name so let's try that a Z group delete then - gee no - n RG - too start deleting our research group okay so you know deleting a research group takes a decent amount of time so deleting this VM has already completed so let's delete resource group one as well in this window what is the command a Z group delete and then we'll just do our G - one all right so while they're deleting let's pause this video and I'll sing backup with you guys once that's done all right so it looks like we've deleted both of our resource groups now and let's just double check in the in our console and so both of those are gone and all we're left with is the default resource group that azure creates so anyways guys that's all I wanted to show you guys in this video hopefully you guys have a basic understanding of how to use the azure seal I and you know I really wanted to emphasize you know use the documentation as much as possible I think I'd done a decent job of explaining you know where to look within the documentation you know and once again they have they give you a plenty of examples so it's just a matter of playing around with it a little bit and you should be able to really do anything that you do in the console through the CLI as well and I guess just to wrap things up make sure that you know once you're done working with the CLI just do an AZ logout just to make sure you logged out so that no one can accidentally you know start running commands on your Azure account and you know spin up massive a mess in Bella for you guys
Info
Channel: Sanjeev Thiyagarajan
Views: 4,775
Rating: undefined out of 5
Keywords: azure, cli, cloud, basics, tutorial, virtual, machine, resource, group, linux, automation, programming, stop, start, vm
Id: azC_2rJ4HV8
Channel Id: undefined
Length: 44min 43sec (2683 seconds)
Published: Mon Jun 15 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.