Azure – Working with Azure CLI
Hello Friends,
Hope you all are doing good !!!
Let’s continuing with our posts on Azure Exam : Developing Microsoft Azure Solutions.
Today in this blog, we will discuss a new Microsoft service CLI (Command Line Interface). Azure Cloud Shell is a service from Microsoft that allows you to have a PowerShell or Bash console right from within your browser. Because it’s browser-based, you don’t have to worry about having any local setup to run PowerShell or Bash. Azure Cloud Shell is truly what the cloud was created for.
Azure Cloud Shell provides browser-based authenticated shell access to Azure from virtually anywhere. Cloud Shell gives the users a rich environment with common tools, that is updated and maintained by Microsoft.
Currently, Azure Cloud Shell provides two environments that can be launched from Azure Portal, dedicated URL, Azure documentation, Visual Studio Code via the Azure Account extension, and Azure App.
- Bash in Cloud Shell that runs Bash shell on Ubuntu Linux, which was made generally available in November 2017.
- Power Shell in Cloud Shell that runs Windows Power Shell 5.1 on Windows Server Core and has been in preview since September 2017.
Now lets configure the Command Line Interface and test few Azure command step by step :).
- Connect to your Azure portal dashboard using your subscription account. If you don’t have any subscription, in that case you can get trial Azure subscription with one-month of validity. Then you can connect to the azure portal dashboard as in following figure.
Figure 1: Azure Certification 70-532 – portal dashboard - Once we are on Azure dashboard, we can click on Command Shell icon to start with configuring the Cloud Shell if it is for the first time or lunch the Cloud Shell as in following figure.
Figure 2: Azure Certification 70-532 – Lunch Cloud Shell - It will lunch a small window with two different option as described at top of the blog.We need to select power shell to proceed with the configuration as in following figure.
Figure 3: Azure Certification 70-532 – Create Required Storage - After selecting the power shell, it will open another small window and ask to create a Storage. To create a storage for the configuration, Click Create Storage button, in back ground, it will maintain a container to share the required files and it will finish with the configuration and lunch the Azure Cloud Shell, as shown in following figure.
Figure 4: Azure Certification 70-532 – Lunching Azure Cloud Shell - We have done with the configuration and now, we will do some testing.For that let’s find out some Azure commands by using Help option of Azure command as shown in the following figure.
Figure 5: Azure Certification 70-532 – List of Azure Commands - In the above figure, we can see many Azure commands, like for Group,VM,Web App, role etc.Now we will start our testing with Azure Group Command.So to continue with Azure group Command, let’s check the available commands for Azure Groups, as shown in the following figure.
Figure 6: Azure Certification 70-532 – List of Azure Group Commands - Using Group command, now we will see the list of Azure Resource Group exists in West India location by providing the location as command’s query parameter.After executing the command, we can see that, currently only one Azure Resource Group exist for West India location, as shown in the following figure.
Figure 7: Azure Certification 70-532 – List of Azure Resource Group under West India - Now let’s create a new Resource Group under West India location, as shown in the following figure.
Figure 8: Azure Certification 70-532 – Create new Azure Resource Group under West India - Now let’s create a new Resource Group under West India location using Azure Group Command, as shown in the following figure.
Figure 9: Azure Certification 70-532 – Create new Azure Resource Group under West India - Now let’s create a new Resource Group named as “ManasTestResource” under West India location using Azure Group Command, as shown in the following figure.
Figure 10: Azure Certification 70-532 – Create new Azure Resource Group under West India
Figure 11: Azure Certification 70-532 – Created new Azure Resource Group under West India - Now let’s delete the newly created Resource Group under West India location using Azure Group Command, as shown in the following figure.
Figure 12: Azure Certification 70-532 – delete newly created Azure Resource Group under West India - As we saw in the above example, we can easily manage many things using power shell without configuring anything in local environment.In this way we can manage VM,Web app, Role etc.Please find following very useful references for further information.
https://azure.microsoft.com/en-in/blog/pscloudshellrefresh/
https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest
https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest
I hope this blog, gives you basic understanding about Command Line Interface.
Thanks for reading 🙂
Keep reading, share your thoughts, experiences. Feel free to contact us to discuss more. If you have any suggestion / feedback / doubt, you are most welcome.
Stay tuned on Knowledge-Junction, will come up with more such articles.
More Posts On Exam : Developing Microsoft Azure Solutions :
Azure – Create New Azure Virtual Machine
Azure – Managing Azure Virtual Machine Disks
Azure – Create An Azure Storage Account.
Azure – Configuring Shared Storage Using Azure File Service
Azure – Create a Virtual Machine with Azure Power Shell
Azure –Deploying a Web App to Azure Virtual Machine with Web Deploy method
Azure – Remote debugging on an Azure VM
Azure – Azure Automation State Configuration
Azure – Configure Azure PowerShell Desired State Configuration (DSC) Through Azure Portal
9 Responses
[…] Developing Microsoft Azure Solutions. In our last blog, we have discussed about Microsoft service Command Line Interface.In that blog we have discussed how to manage and execute powershell command by browser without […]
[…] Azure – Certification 70-532-Part 5 – Working with Azure CLI […]
[…] Azure – Certification 70-532-Part 5 – Working with Azure CLI […]
[…] Azure – Certification 70-532-Part 5 – Working with Azure CLI […]
[…] Azure – Certification 70-532-Part 5 – Working with Azure CLI […]
[…] Azure – Certification 70-532-Part 5 – Working with Azure CLI […]
[…] Azure – Certification 70-532-Part 5 – Working with Azure CLI […]
[…] Azure CLI: As we said earlier in this blog, there are different way to work with Azure Resource Provider as we did with powershell. Now we will use Azure CLI to achieve same goal. In our one of last blog we have discussed how to start Working with Azure CLI. […]
[…] Azure – Certification 70-532-Part 5 – Working with Azure CLI […]