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

No documentation on how to install specific version of an extension. #1123

Closed
ggorman opened this issue Nov 28, 2019 · 3 comments
Closed

No documentation on how to install specific version of an extension. #1123

ggorman opened this issue Nov 28, 2019 · 3 comments
Assignees
Labels
Customer Insights feature-request This issue requires a new behavior in the product in order be resolved.
Milestone

Comments

@ggorman
Copy link

ggorman commented Nov 28, 2019

  • If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at Azure/azure-cli

Extension name (the extension in question)

Any (specifically experienced for image-copy-extension)

Description of issue (in as much detail as possible)

Some issue responses advise using a specific version number of an extension (eg #979). However, az extension does not include document any way to specify a version number.


@haroldrandom
Copy link
Contributor

As far as I know, currently, extensions don't have the ability to install by specific version.

@ggorman
Copy link
Author

ggorman commented Nov 29, 2019

The following command at least allows one to use the pre-release version of an extension. Good when a patch is required.
pip install --upgrade --target ~/.azure/cliextensions/image-copy-extension "git+https://github.com/Azure/azure-cli-extensions.git#subdirectory=src/image-copy&egg=image-copy-extension"

@yonzhan yonzhan added this to the S163 milestone Dec 1, 2019
@yungezz yungezz modified the milestones: S163, S165 Jan 3, 2020
@fengzhou-msft
Copy link
Member

@ggorman Currently we don't have production support for installing previous extension version. But you can install through --source option. image-copy-extension is a good example since it's published on pypi. You can get the download link for any previous versions on pypi. Then run az extension add --source https://download/link/to/specific/version/wheel/file.whl.

Most extension wheel files are stored in storage account. In our index.json, some extensions already listed the downloadUrl for multiple versions such as storage_preview. For those that only shows the latest version, you can use the following hack taking netappfiles-preview as an example:

  1. check the current download url in index.json.
  2. check the History.rst file for previous versions.
  3. Replace the version you need in the current download url, for instance you want 0.3.0, the link becomes https://anfclipython.blob.core.windows.net/cli-extensions/netappfiles_preview-0.3.0-py2.py3-none-any.whl
  4. Install with az extension add --source https://anfclipython.blob.core.windows.net/cli-extensions/netappfiles_preview-0.3.0-py2.py3-none-any.whl.

This hack is not guaranteed to work for all extensions since they are maintained by different teams. They have the liberty to store the wheel file in any different public locations for each verison.

We may consider adding production support for installing specific extension version in the future.

@ghost ghost added feature-request This issue requires a new behavior in the product in order be resolved. and removed Feature Request labels Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Insights feature-request This issue requires a new behavior in the product in order be resolved.
Projects
None yet
Development

No branches or pull requests

5 participants