Azure / azure-iot-cli-extension

Azure IoT extension for Azure CLI
Other
82 stars 65 forks source link

Cannot Add Azure IoT Extension #576

Closed ninghust closed 1 year ago

ninghust commented 1 year ago

Describe the bug Hi, I'm trying to add azure iot cli extension using command az extension add --name azure-iot but keep getting an error

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 NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7f72893ac0>: Failed to establish a new connection: [Errno 111] Connection refused')) image

Here is my azure version in WSL image

Environment (please complete the following information):

Additional context Add any other context about the problem here.

digimaun commented 1 year ago

Hi @ninghust is this still an issue? When installing an extension by name, the CLI will first fetch the extension index and parse metadata of a target extension which includes compatible python runtimes, where an extension package is available, and its hash. The extension index fetch follows the redirect from the following url https://aka.ms/azure-cli-extension-index-v1 to https://azcliextensionsync.blob.core.windows.net/index1/index.json.

The error shows a network issue, can you please validate you are not under a network configuration that prevents access to the links I shared?

ninghust commented 1 year ago

Hi @ninghust is this still an issue? When installing an extension by name, the CLI will first fetch the extension index and parse metadata of a target extension which includes compatible python runtimes, where an extension package is available, and its hash. The extension index fetch follows the redirect from the following url https://aka.ms/azure-cli-extension-index-v1 to https://azcliextensionsync.blob.core.windows.net/index1/index.json.

The error shows a network issue, can you please validate you are not under a network configuration that prevents access to the links I shared?

Hi @digimaun, yes, it's still an issue...I can access https://azcliextensionsync.blob.core.windows.net/index1/index.json via web but from WSL ping it, cannot receive data. Finally, I downloaded .whl extension file to my local and I installed iot extension.

digimaun commented 1 year ago

Understood. Have you looked into possible nameserver issues in /etc/resolv.conf ? This stackoverflow thread has some other ideas to try as well.

Because the problems you are dealing with are with WSL configuration, and not az cli or the azure-iot extension, I'd like to close this issue as off-topic.

digimaun commented 1 year ago

Closing due to reasons explained here.