Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the alternative approaches to install Azure CLI on Ubuntu without root access?

I am struggling to install Azure CLI on a Ubuntu machine without root access.

The instructions here assume that we have root access (or reasonable sudo access).

I am trying to run this on a Ubuntu machine (provided by IBM DevOps toolchain - root access will never be granted) where executing the sudo command results in:

AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | \
     sudo tee /etc/apt/sources.list.d/azure-cli.list

This results in sudo: no tty present and no askpass program specified

Why do I need a tty to run sudo? has some answers however I am not able to use them as I don't have control over the login to the shell via ssh.

I am using the IBM Cloud's DevOps toolchain to deploy applications to both IBM Cloud and Azure.

The DevOps toolchain provides me a shell for me to execute commands.

Are there other alternatives

like image 826
Manglu Avatar asked Oct 24 '25 03:10

Manglu


1 Answers

Assuming that you have the required prerequisites installed, you can either use the script or plain 'ole pip to install the Azure CLI (pip install azure-cli). Personally, I often use the docker container as well.

like image 156
Johan Stenberg - MSFT Avatar answered Oct 25 '25 22:10

Johan Stenberg - MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!