This repository serves two purposes and they are independent:
src, to host your extension source code.
For documentation on authoring an extension, see Extension Documentation
https://aka.ms/azure-cli-extension-index-v1every few minutes.
az extension add --source https://contoso.com/mywheel.whl.
az extension list-availablecommand and to update to a new version of your extension, the user has to first remove the currently installed extension and then add the new version.
Add your extension to the index to make it available in these CLI commands:
az extension add --name NAME- Allows users to add an extension by name
az extension list-available- Allows users to list the available extensions in the index
az extension update --name NAME- Allows users to update an extension
.whl) will not live in this repository. You can publish your extension to PyPI or somewhere else such as Azure Storage.
There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update
The precondition is to put your code inside this repo and upgrade the version in the PR but not to modify
If you want to host the source code in your dedicated repo, you have to upload the WHL file and update the
For detail, please visit Publish section in Azure CLI Extension Authoring.
If you use
azdev extension update-index the command will calculate the SHA256 digest for you. For more information visit https://github.com/Azure/azure-cli-dev-tools.
As a fallback:
shasum -a 256 path_to_whl.whl
Windows / PowerShell
Get-FileHash path_to_whl.whl -Algorithm SHA256
Note: Hash should be in lowercase in index.json otherwise CI will fail.
azdev extension update-index command can be used to simplify the process of updating the index file. Run
azdev extension update-index <URL> where URL is the fully-qualified URL to your published extension WHL. This will gather the appropriate metadata and add an entry for your extension to the index. For more information visit https://github.com/Azure/azure-cli-dev-tools.
As a fallback:
The metadata needed to be filled is a combination of the contents present in:
metadata.jsonlocated in your unzipped extension artifact (
.whlfile) in the
<package>-<version>.dist-infodirectory. This metadata is garnered from the
azext_metadata.json(if it exists) under your extension.
Note that CI will fail if this metadata does not match the contents of your published extension.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact email@example.com with any additional questions or comments.