In this blog post, I will show you how to download and the Microsoft Azure CLI Docker Container image and run Azure CLI commands.
Azure CLI command like utility is similar to AWS CLI and allow us to manage Microsoft Azure resources from the command line.
Currently, Azure CLI is available using an installer where you install on your machines or using Cloud Shell.
The Docker container image gives us the flexibility to Azure CLI commands from inside a container and not worrying about the local machines.
It also offers a better security environment.
To download the Azure CLI image which runs on Linux and Microsoft Containers, I will use the following pull command.
docker pull microsoft/azure-cli
As you can see below, The image size is 910 MB.
docker images microsoft/azure-cli
To run a Docker container with the Azure CLI command, I will use the following command.
Note – I’m using the –rm switch which will delete the container on exit.
docker run --rm -it microsoft/azure-cli:latest
From inside the container I can use the –help switch below to view all the available az cli commands.
To connect to Microsoft Azure, I will use the following command an authenticate.