Intro
If you prefer to run your azure commands on your local machine, instead of the cloud shell, This blog will help you to start setting up.
Okay, that was a very long sentence🤪, please don’t mind.
Installation
First things first,
We have two options – Refer here
- Installing it directly on your local machine,
- Installing it as a docker container
I am going with the second option. If you have doubts on first, ask in the comments below or kindly dm me.
I chose 2 since, the container is going to be Linux based and isolated from my local machine which can be anything ( Mine is windows )
Steps
The first step is to run docker in your machine, we are about to pull an image and run it.
Once docker started, you can proceed with the command below.
docker run -it mcr.microsoft.com/azure-cli
This pulls an image from MCR (Microsoft Container Registry). The image is specifically for using Azure-CLI.
Once it is installed, open the container – A terminal will popup from the container.
You can check that it is a real Linux terminal🤪 by using “ls” or any other commands you remember of.
Login
Once you are back, login to azure through the terminal using the below command.
az login
This will prompt a browser window asking for a code which was already displaying in your terminal.
Once you login, you will get some weird JSON like output.
Azure Products and especially Kubernetes
Once logged in you can explore by using any azure products using the command below
az ____
The __ implies that you can use any azure product like “vm” or “aks” or anything else.
Example
az vmaz vm list
Read below, if you want to setup AKS – Kubernetes.
az aks get-credentials --resource-group yourResourceGroupName --name yourClusterName
The cluster name and the resource group name can be found in your portal if you have already created a cluster in kubernetes, else create one and use it here.
So that’s it for the blog, let me know what do you think and comment down if you have a doubt.
Have a great day, people!
Tataaa!
]]>