pip error while installing azure cli extension behind proxy

半世苍凉 提交于 2021-01-29 14:30:27

问题


could someone help me please:

I am using Azure cli behind proxy and I have fiddler running. I am running following commands and setup to login into my azure account,

SET ADAL_PYTHON_NO_SSL_VERIFY=1
SET AZURE_CLI_DISABLE_CONNECTION_VERIFICATION=1        
az login --tenant <company domain>

It works well and gives me the list of subscriptions associated with my account.But, I need to install Azure-devops extension and when i run:

az extension add --name azure-devops

I am getting error: cli.azure.cli.core.util : An error occurred. Pip failed with status code 1.

looking into fiddler it says: 407 proxy authentication error while connecting to on premise nexus. My pip config:

[list]
format=columns
[global]
disable-pip-version-check = true
trusted-host = nexusurl
index = https://[username]:[userpassword]@<nexusurl>
index-url = https://[username]:[userpassword]@<nexusurl>

i couldnt figure out what i am missing.


回答1:


I had a similar issue. I did the following:

  1. Browse to the file C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\certifi\cacert.pem.
  2. Edit the file and add the certs in Base-64 format that is part of the cert chain that takes you to https://pypi.org/simple/distro/.
  3. Run the following command to set the CA Bundle environment variable to this file.

.

setx REQUESTS_CA_BUNDLE "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\certifi\cacert.pem" /M


来源:https://stackoverflow.com/questions/61122231/pip-error-while-installing-azure-cli-extension-behind-proxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!