Installing the Azure CLI 2.0 on RedHat and Ubuntu Linux

I'm Mark and I'm going to show you how to install the Azure CLI 20 on a computer running Linux

What I'm going to show you will work on most Linux distributions, In this video I'm going to show how it's done on a server running Ubuntu 1604 LTS and a server running RedHat Enterprise Linux 73 The process is pretty similar on both servers There are some pre-requisites that you may need to install if they're not present

Let's do that first on the Ubuntu server So, here goes sudo apt-get update && sudo apt-get install -y the libssl-dev package libffi-dev package python-dev package and the build-essential package Hit return and we'll let that run Let's flip over to our RedHat server

The pre-requisite install is a little different, mainly just because RedHat uses a different package manager to Ubuntu So, we sudo yum check-update; sudo yum install -y gcc libffi-devel python-devel and openssl-devel Ok and that's the RedHat pre-requisites installing So, let's go back to our Ubuntu server which should now be ready for us to install the Azure CLI Right, so we're going to use curl curl -L https and then the URL akams/InstallAzureCli pipe to bash Hit return on that It's downloading the scripts It's asking a few questions here about where to install things, so we'll just accept the default values And off it goes This part of the installation is exactly the same on the RedHat server, so you'd enter the same curl command and the installation would happen the same way

At the end, we're prompted to update our path and rc file, so we'll just accept the defaults for this And we're done OK, let's restart the shell And now if we type "az" And it works Let's just confirm the version of the CLI that's been installed And as you can see, version 2 is installed

That's it We're ready to manage Microsoft Azure from a Linux server

Source: Youtube