Azure az behind corporate proxy
How to configure the Azure CLI to work behind a corporate proxy by appending your proxy CA certificate to the certifi bundle.
Azure az behind corporate proxy
URL that solves the problem with being behind a corporate proxy
Reference: https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively?tabs=bash%2Cbash2
When working behind a corporate proxy, the Azure CLI may fail SSL verification because it does not trust the proxy’s CA certificate. The fix is to append your proxy CA certificate to the certifi CA bundle that the Azure CLI uses internally. After updating the bundle, set the REQUESTS_CA_BUNDLE environment variable so that the Python requests library picks it up.
1
2
3
4
5
6
7
8
# https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively?tabs=bash%2Cbash2
cat ~/Documents/proxyCA.crt >> /usr/local/Cellar/azure-cli/2.39.0/libexec/lib/python3.10/site-packages/certifi/cacert.pem
# Latest version
brew config
cat ~/Documents/proxyCA.crt >> /opt/homebrew/Cellar/azure-cli/2.57.0/libexec/lib/python3.11/site-packages/certifi/cacert.pem
export REQUESTS_CA_BUNDLE=/opt/homebrew/Cellar/azure-cli/2.57.0/libexec/lib/python3.11/site-packages/certifi/cacert.pem
az login
This post is licensed under CC BY 4.0 by the author.