Introduction of Azure Cloud Shell

This article provides you an information about Azure Cloud Shell to interact and access the Azure Resources.

Azure Cloud Shell is a browser-accessible, interactive shell for managing the Azure resources.  It gives you the flexibility to access the shell based on the area you are working. Bash experience for linux and Powershell experience for the Windows users.
 
You can access the Cloud shell on your browser or through the Azure portal.
 
To access through the browser you can access the below link. 
or Try from Azure portal using the cloud shell icon .
 
 
If you are the first time user, when you access the Cloud shell it will ask you to choose the Bash or Powershell type of experience you need. But next time when you access the cloud shell it will automatically choose the most recently used environment. In our case, lets go ahead and choose the Powershell. 
 
Note:  You can change shells any time via the environment selector in the cloudshell toolbar.
 
 
 
Next important thing to notice is that, at first time when you access the cloud shell it will ask you to create the storage to be mounted with the current subscription.
 
 
Once you click on "Create Storage" it will automatically create a storage inside the azure environment. The beauty of the Cloud shell environment is having the integrated cloud shell editor. Meaning, you can run both CLI and Powershell command files through this Cloud shell itself.
 
When everything is created, the cloud shell window will be displayed with the azure drive on the screen.
 
 
 
Now we have azure cloud shell created on our subscription. To see the directory or how the data are getting stored simply execute the below code. 
  1. Get-ChildItem "./visual studio demo account/"  
 
 
In our Cloud shell window, we also have powershell commands integrated to execute. To check that, lets execute the powershell command to list all the Virtual machines available on the current subscription.
 
Please find the code below:
 
 
 
In cloud shell window to make the directory from default directory to your azure home directory execute the below code to see your home directory
 
 
 
Inside our home directory we can find the cloud directory to persistently store our files for our future reference. 
 
 
 
Here in the clouddrive lets create dhana1.PS1 file using the below code. 
  1. vi dhana1.ps1  
 Once the file is created enter the below code and save the file using :wq command.
 
 
 
This PS will fetch the list of all the VM available in the azure portal. To execute the file enter the code and press enter.
 
  1. ./dhana1.ps1  
 This will list all the VM's available in the Azure Portal.
 
 
 
Like this, we can execute our commands in this window.  In our Next Article, we will see about below components (Icons) available on
this cloud shell window.
 
 
 
                                                                                                                    Next Article  >>  Azure Cloud shell Features
 
Conclusion:
 
We have seen some powershell commands to create the storage and create & execute the PS files. Likewise, you can create CLI commands and execute in Cloud shell window.
 
It is the fantastic tool, easy to use and execute our needs. We are not going to maintain instead microsoft will do that for us with no cost.
 
Thank you for your support !!