Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

Allow non-interactive install of az cli using script #21361

Open seansund opened 2 years ago

seansund commented 2 years ago

Is your feature request related to a problem? Please describe. I'm trying to install the az cli using the script approach (curl -L https://aka.ms/InstallAzureCli | bash) in an automated fashion. Unfortunately, the script prompts for a number of directories with no apparent way to provide those values via command line arguments or environment variables so the script can't run headless.

Describe the solution you'd like Allow the INSTALL_DIR and BIN_DIR values to be provided either as command line arguments or environment variables.

Alternatively, if the CLI could be downloaded as a single binary instead of a python script that must be initialized that would be great.

Describe alternatives you've considered Installing via a package manager is not viable in this case because 1) we don't have the necessary permissions on the system and 2) need to support a variety operating systems.

Additional context

yonzhan commented 2 years ago

@jiasli for awareness