Prerequisites:
- Azure subscription
- Azure CLI installed on your machine
- Basic knowledge of Azure resources and CLI commands
Azure Cli is a tool for creating and managing Azure resources, its all text base with no graphical interface. It saves you alot of time, you can use a single command to manage a resource.
TO INSTALL AZURE CLI ON WINDOW
go to https://aka.ms/installazurecliwindows and download the installer, run the downloaded installer and follow the prompts. , click next, next and install. sign in with cli and login into Azure Cli.
USING AZURE CLI WITH CLOUDSHELL
Log in to shell.azure.com it will take you through the login process and you will get to the screen here
you will have to choose Bash or powershell as your shell environment. first for it to work you will have to attach a storage account. i created my storage which it successfully sync to the cloud shell.
why the storage account ? because it has to store all the data and files you might upload. once cloudshell is launched you can use Azure cli, to create, manage and delete Azure resources.
COMMON AZURE CLI COMMANDS
az command list
it lists all the accounts available to this login.
az group create
,az vm create
, command likeaz vm --help
this gives you all the commands availablein the az vm.
![]()
EXERCISES
Exercise 1: Create a Resource Group
Open Azure CLI and login to your Azure account using
az login
.Create a new resource group using
az group create --name <resource_group_name> --location <location>
, this time through cloud shell.
Verify the resource group creation using
az group show --name <resource_group_name>
. note the second group was created throgh cloud shell.
So this is basically how Azure Cli works. you can use it to manage resources such as virtual machines,storage accounts and resource groups.
Top comments (0)