Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure CLI #1

Open
Hc2Life opened this issue Aug 4, 2024 · 0 comments
Open

Azure CLI #1

Hc2Life opened this issue Aug 4, 2024 · 0 comments

Comments

@Hc2Life
Copy link
Owner

Hc2Life commented Aug 4, 2024

rm -r /lib/azure-cli
rm /bin/az

/lib/azure-cli/az.completion

/lib/azure-cli/az.completion

rm -rf ~/.azure

curl https://azurecliprod.blob.core.windows.net/install | bash

hash -r

/bin

No auth

export HTTP_PROXY=http://[proxy]:[port]
export HTTPS_PROXY=https://[proxy]:[port]

Basic auth

export HTTP_PROXY=http://[username]:[password]@[proxy]:[port]
export HTTPS_PROXY=https://[username]:[password]@[proxy]:[port]

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

sudo dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm

sudo dnf install -y https://packages.microsoft.com/config/rhel/8/packages-microsoft-prod.rpm

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" | sudo tee /etc/yum.repos.d/azure-cli.repo

sudo dnf install azure-cli

dnf list --showduplicates azure-cli

sudo dnf install azure-cli--1.el7

az upgrade

sudo dnf remove azure-cli

sudo rm /etc/yum.repos.d/azure-cli.repo

MSFT_KEY=rpm -qa gpg-pubkey /* --qf "%{version}-%{release} %{summary}\n" | grep Microsoft | awk '{print $1}'
sudo rpm -e --allmatches gpg-pubkey-$MSFT_KEY

rm -rf ~/.azure

curl -sL https://
azurecliprod.blob.core.windows.net/rhel7_6_install.sh | sudo bash

PYTHON_VERSION="3.6.9"
PYTHON_SRC_DIR=$(mktemp -d)
wget -qO- https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz | tar -xz -C "$PYTHON_SRC_DIR"
cd $PYTHON_SRC_DIR/Python-$PYTHON_VERSION
./configure --prefix=/usr --with-openssl=/usr/local/ssl
make
sudo make install

sudo dnf download azure-cli
sudo rpm -ivh --nodeps azure-cli-*.rpm

No auth

export HTTP_PROXY=http://[proxy]:[port]
export HTTPS_PROXY=https://[proxy]:[port]

Basic auth

export HTTP_PROXY=http://[username]:[password]@[proxy]:[port]
export HTTPS_PROXY=https://[username]:[password]@[proxy]:[port]

[main]

...

proxy=http://[proxy]:[port] # If your proxy requires https, change http->https
proxy_username=[username] # Only required for basic auth
proxy_password=[password] # Only required for basic auth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant