- Login to Azure portal.
- Go to Resource Groups and click
+Add
. - Provide the name of the resource group (e.g.,
az-shell
) and make sure an appropriate region is selected. - Click
Review + create
. - Go to Virtual machines and click
+Add
. - For Resource group select the one you have just created. Provide the name of the new VM (e.g.,
az-shell-vm
) and make sure an appropriate region is selected. For Image go with Ubuntu Server 18.04 LTS. As size pick something minimal, such asB1ls
. Change Authentication type to Password. Fill in the Username and Password (remember them as you will need them later). Leave the default Inbound port rules unchanged (Allow SSH (22)). - Click
Review + create
. - Download and install Putty.
- Go to the VM you just created and copy the public IP.
- Open Putty. In the Host Name field fill in
<your-username>
@<public-ip-of-your-vm>
.
- Click
Open
and enter your password when prompted. If everything went right you should see a screen similar to the below.
- Install Azure CLI.
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- In Azure portal go to Azure Active Directory and copy your Deafult Directory Tenant ID.
- Login to your az acount by issuing the below command in Putty.
az login --use-device-code --tenant <your-tenant-id>
- In your browser go to https://microsoft.com/devicelogin and enter the code displayed on the Putty screen.
- Login to your Azure account. If everything went well you should see the below in your browser.
- Enjoy working in Azure CLI!
- When you are done with your work you can exit from the Putty session with the
exit
command. You can always come back by repeating steps 10, 11, 14, 15, and 16.
The instance you have provisioned should cost around $4/month. If you want to minimize the cost Stop
the machine when you do not need it (the VM page in Azure portal) and Start it when you do.
Delete the Resource group once you no longer have a need for the machine.