How to install azure cli on amazon ec2.
- Launch ec2 instance.
- Login to linux machine.
sudo su // become root user
- Copy this – sudo rpm – import https://packages.microsoft.com/keys/microsoft.asc
- Copy paste this lines
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.