如何在 Windows 上配置企业代理后面的 azure-cli
How to configure azure-cli behind a corporate proxy on Windows
我在公司代理后面使用 Windows 10,az --version
输出以下内容:
azure-cli 2.5.1
command-modules-nspkg 2.0.3
core 2.5.1
nspkg 3.0.4
telemetry 1.0.4
...
Unable to check if your CLI is up-to-date. Check your internet connection.
此外,az extension list-available
抛出:
Unable to get extension index.
Please ensure you have network connection. Error detail: HTTPSConnectionPool(host='aka.ms', port=443): Max retries exceeded with url: /azure-cli-extension-index-v1 (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)))
如何为企业代理配置 azure-cli?
对于 Windows 10,您可以在 Settings > Network & Internet > Proxy
窗格中检查代理设置。请联系您的系统管理员以了解所需的设置,或者您的计算机可能受配置管理或需要高级设置的情况。
- 从 http://wpad/wpad.dat
下载本地代理配置
- 在
wpad.dat
文件的开头有一行类似于 CWSProxy="PROXY proxy.corporation.com:8082";
- 将代理服务器输入环境变量HTTPS_PROXY,例如在 bash 中:
export HTTPS_PROXY="proxy.corporation.com:8082"
现在 az extension list-available
连接。但是,出于某种原因,az --version
仍然提供 Unable to check if your CLI is up-to-date. Check your internet connection.
您现在无论如何都可以安装 az extension add --name azure-devops
.
等扩展
我在公司代理后面使用 Windows 10,az --version
输出以下内容:
azure-cli 2.5.1
command-modules-nspkg 2.0.3
core 2.5.1
nspkg 3.0.4
telemetry 1.0.4
...
Unable to check if your CLI is up-to-date. Check your internet connection.
此外,az extension list-available
抛出:
Unable to get extension index.
Please ensure you have network connection. Error detail: HTTPSConnectionPool(host='aka.ms', port=443): Max retries exceeded with url: /azure-cli-extension-index-v1 (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)))
如何为企业代理配置 azure-cli?
对于 Windows 10,您可以在 Settings > Network & Internet > Proxy
窗格中检查代理设置。请联系您的系统管理员以了解所需的设置,或者您的计算机可能受配置管理或需要高级设置的情况。
- 从 http://wpad/wpad.dat 下载本地代理配置
- 在
wpad.dat
文件的开头有一行类似于CWSProxy="PROXY proxy.corporation.com:8082";
- 将代理服务器输入环境变量HTTPS_PROXY,例如在 bash 中:
export HTTPS_PROXY="proxy.corporation.com:8082"
现在 az extension list-available
连接。但是,出于某种原因,az --version
仍然提供 Unable to check if your CLI is up-to-date. Check your internet connection.
您现在无论如何都可以安装 az extension add --name azure-devops
.