Setup azure cli on aws ec2 instance

How to install azure cli on amazon ec2.

  1. Launch ec2 instance.
  • Login to linux machine.

sudo su               // become root user

sudo sh -c ‘echo -e “[azure-cli]
name=Azure CLI
baseurl=https://packages.microsoft.com/yumrepos/azure-cli
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc” > /etc/yum.repos.d/azure-cli.repo’

yum install azure-cli -y

Configure AZ

Run az login.

open this on your browser.

https://microsoft.com/devicelogin

Then give code and wait for 2 min on CLI.

you will get your account information.

Then run this az account set -s “Your_subscription_ID“.

Verify

az account show.

You successfully configure your Azure CLI on AWS EC2 Instance.

Leave a Reply

Your email address will not be published. Required fields are marked *