Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Installing extensions in offline environments #2484

Open
NenoLoje opened this issue Oct 5, 2020 · 11 comments
Open

Question: Installing extensions in offline environments #2484

NenoLoje opened this issue Oct 5, 2020 · 11 comments
Assignees
Labels
DevOps Packaging Package question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.

Comments

@NenoLoje
Copy link

NenoLoje commented Oct 5, 2020

(Note: This is a cross-post from Azure/azure-devops-cli-extension#1055)

How to set up an Azure CLI 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. (I'm trying to install the Azure DevOps extension and 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?

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 5, 2020
@yungezz yungezz added the Packaging Package label Oct 5, 2020
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Oct 5, 2020
@yungezz
Copy link
Member

yungezz commented Oct 5, 2020

hi @fengzhou-msft could you pls help on this?

@gabrielmccoll
Copy link

I'm having same problem due to trying to go through corporate proxy and I just keep hitting more and more stuff that wants whitelisted. I'd really love to be able to just download the extensions and required packages offline and distribute them internally as I won't get this past security in current state. Azure Devops cli extension seems to be only way for universal package uploads for instance ?

@NenoLoje
Copy link
Author

@gabrielmccoll Specifically for the case you mentioned regarding uploading/downloading universal packages, the workaround I used is to:

  • install an 🚀 Azure Pipelines agent on that machine (the corporate firewall in my case had the neccessary execptions it already configured)
  • and use the Universal Package task (which supports up- and downloading). No need to install Azure CLI or the Azure DevOps extension at all.

Hope it helps!

@gabrielmccoll
Copy link

@gabrielmccoll Specifically for the case you mentioned regarding uploading/downloading universal packages, the workaround I used is to:

  • install an 🚀 Azure Pipelines agent on that machine (the corporate firewall in my case had the neccessary execptions it already configured)

  • and use the Universal Package task (which supports up- and downloading). No need to install Azure CLI or the Azure DevOps extension at all.

Hope it helps!

That is a nice wee work around thank you

@JariSal
Copy link

JariSal commented Oct 28, 2020

Also I'm trying to install Azure DevOps extension into a separate development machine, but corporate proxy prevents the pip to fetch the required modules from pypi.org. I've installed those modules manually, but DevOps extension does not check the currently installed modules and tries to fetch those from pypi.org every time. Any possibilities to make DevOps installation to just use already installed modules?

@fengzhou-msft
Copy link
Member

@JariSal the extension is not installed in standard python package location, you can check with az --version. By default it's ~/.azure/cliextensions. Please install its dependency packages under ~/.azure/cliextensions/azure-devops/

@fengzhou-msft
Copy link
Member

fengzhou-msft commented Nov 27, 2020

azure-devops currently specifies 3 dependencies, only distro is not in azure-cli (the version requirement for python-dateutil is different, not sure if it will cause problems). @NenoLoje you need to install azure-devops with --no-deps and then install the distro package with --target ~/.azure/cliextensions/azure-devops

"distro (==1.3.0)",
"msrest (<0.7.0,>=0.6.0)",
"python-dateutil (==2.7.3)"

@fengzhou-msft fengzhou-msft added DevOps Service Attention This issue is responsible by Azure service team. labels Nov 27, 2020
@ghost
Copy link

ghost commented Nov 27, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @narula0781, @ashishonce, @romil07.

Issue Details

(Note: This is a cross-post from Azure/azure-devops-cli-extension#1055)

How to set up an Azure CLI 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. (I'm trying to install the Azure DevOps extension and 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?

Author: NenoLoje
Assignees: fengzhou-msft
Labels:

DevOps, Packaging, Service Attention, question

Milestone: -

@fengzhou-msft
Copy link
Member

fengzhou-msft commented Nov 27, 2020

Route to service team to see if they can remove the msrest and python-dateutil dependencies which are already installed with the azure-cli package. distro is a very simple package, you may also considering vendoring its source code.

@dimalyshev
Copy link

dimalyshev commented Mar 29, 2021

Hope it helps
command from https://docs.microsoft.com/en-us/cli/azure/extension?view=azure-cli-latest
az extension add --source ~/anextension-0.0.1-py2.py3-none-any.whl --pip-proxy https://user:pass@proxy.server:8080

as for me this works
first dowload what you need from https://azcliextensionsync.blob.core.windows.net/index1/index.json

to install devops extension
python.exe -m pip install --target "~\.azure\cliextensions\azure-devops" azure_devops-0.12.0-py2.py3-none-any.whl --proxy "http://proxy_to_pip_repo/" -vv --disable-pip-version-check --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org

to install devops login dependency
python.exe -m pip install --target "~\.azure\cliextensions\azure-devops" keyring~=17.1.1 --proxy "http://proxy_to_pip_repo/" -vv --disable-pip-version-check --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org

@fengzhou-msft fengzhou-msft removed their assignment Jul 4, 2022
@TheOnlyWei
Copy link
Contributor

TheOnlyWei commented May 8, 2024

Hi @fengzhou-msft, are there any updates for this? We need to install Azure CLI extensions on disconnected environments. Would be good if there is a work-around or script to set up an environment so that customers can run Azure CLI extension commands in an offline environment without differences in user-experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevOps Packaging Package question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

8 participants