Microsoft Azure – Azure App Service Managed Certificates
In this article, we will learn what you can do with the Azure CLI Interactive Mode. You can do a lot of powerful things with the Azure CLI like create web apps and VMs and you can do even more with the CLI when you use its interactive mode.
Let’s try that. We’ll try that in the Azure Cloud Shell, but you can also use an Azure CLI that is installed on your local machine. You can access the interactive mode by typing the below command:
This changes the look and the feel of the CLI. Now we can start typing CLI commands like to create a resource group, use the below command:
group create --name <YOUR RESOURCE GROUP NAME> --location <YOUR LOCATION>
It shows similar commands that we’ve used before, it also shows which parameters are available and which ones are required, and as you can see, it provides autocomplete to help us. This is so useful. Especially when we need to pick a location, we always forget the location names.
Here, it tells us what the command does as shown below:
And below that, it shows examples of how we can use the command. That is really helpful.
Let’s create an App Service plan using the below command:
appservice plan create --name <YOUR PLAN NAME> --resource-group <YOUR RESOURCE GROUP>
In this command, we can use parts of the output of the previous command. So when wean created the resource group, it returned an adjacent string with values like ID and name and we can query the name of the resource group as shown:
Let’s do something else, let us get the information from a web app with the show command.
You can see how the interactive mode really helps us here. You might have noticed that we are in the scope of the az command, so we never have to type az and if we want to keep working with the web app command but don’t want to type web app all the time, we can scope to the web app command as shown below:
From this scope, we can directly use commands like Stop to stop a web app:
And we can also back out of the scope to the root with the below command:
We can also execute shell commands like a Bash command to create a directory without leaving the interactive mode and cd into the directory.
You can be very productive with Azure with the Azure CLI and you can be even more productive when you use the Azure CLI interactive mode.
Please Login to comment...