azure-devops-cli-extension icon indicating copy to clipboard operation
azure-devops-cli-extension copied to clipboard

Question: Azure DevOps extension in offline environments

Open NenoLoje opened this issue 5 years ago • 3 comments

How to set up the Azure DevOps extension in an offline environment?

I see that the Azure CLI supports installing from a local source like this: az extension add –source …

… but this doesn't seem to be enough. (It fails when it runs "pip", which tries to connect to public sources…).

Any tips on how an offline / or x-copy-like deployment looks like?

NenoLoje avatar Oct 05 '20 09:10 NenoLoje

Instructions extended with tips from the cross-post in azure-cli-extensions:

  • Download the latest wheel (*.whl) from https://github.com/Azure/azure-devops-cli-extension/releases
  • Download the wheel for distro==1.3.0: pip wheel --wheel-dir ~\Downloads distro==1.3.0 --no-deps
  • In your offline environment use: pip install --target ~/.azure/cliextensions/azure-devops --no-deps --no-index --find-links=~\Downloads azure_devops distro

An alternative would be to let pip use a private pypi index by setting PIP_INDEX_URL and possibly some other environment variables (most/all cli options can be passed via environment variables to pip).

The fact that the following steps fail with an error looks like a bug to me:

  • Download the latest wheel (*.whl) from https://github.com/Azure/azure-devops-cli-extension/releases
  • In your offline environment use: az extension add -s azure_devops-0.19.0-py2.py3-none-any.whl

The last step gives this error in offline environment: An error occurred. Pip failed with status code 1. Use --debug for more information. And if you re-run with debug you see that it's trying to install distro==1.3.0 from pypi.org.

fedorbirjukov avatar Mar 05 '21 15:03 fedorbirjukov

@fedorbirjukov The first solution is not working for me as it requires another package called keyring when I try to login to the devops server using az devops login

When I try to install keyring also manually, it complains that there is a version conflict with setuptools

tinomthomas avatar Apr 08 '21 11:04 tinomthomas

We got the same issue and had to install the extension and its dependencies manually:

    # Download the azure-devops extension
    # See https://learn.microsoft.com/en-us/cli/azure/azure-cli-extensions-list
    # See https://github.com/Azure/azure-devops-cli-extension/releases/tag/20240514.1
    wget https://github.com/Azure/azure-devops-cli-extension/releases/download/20240514.1/azure_devops-1.0.1-py2.py3-none-any.whl  
    # Download the dependencies of azure-devops extension
    wget https://files.pythonhosted.org/packages/f6/b1/ba5a96bccd3496241d8908164b9502a129156443cdd5acbdbf04a90b7a09/distro-1.3.0-py2.py3-none-any.whl

    # Install the azure-devops extension
    /opt/az/bin/python3 -m pip install --disable-pip-version-check --target ~/.azure/cliextensions/azure-devops --no-deps distro-1.3.0-py2.py3-none-any.whl
    /opt/az/bin/python3 -m pip install --disable-pip-version-check --target ~/.azure/cliextensions/azure-devops --no-deps azure_devops-1.0.1-py2.py3-none-any.whl
    # Verify the azure-devops extension
    az extension list
    az devops -h

sonnykt avatar Jul 11 '24 05:07 sonnykt