azure-devops-cli-extension
azure-devops-cli-extension copied to clipboard
[Feature Request] `az pipelines release create` Expose an parameter to specify instanceReference.name
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I cannot create a project..
Issued code: https://github.com/Azure/azure-devops-cli-extension/blob/2bd72a1d76cc00a84b348f573e9f8e14dfb42c5b/azure-devops/azext_devops/dev/pipelines/release.py#L47
Currently, we can only specify version_id
though --artifact-metadata-list
but we cannot specify name. And the payload looks like below:
{"artifacts": [{"alias": "SomeAlias", "instanceReference": {"id": "1234567"}}], "definitionId": 123}
This leads to ugly release run name - usually we have a build number in the release name but the release triggerred from CLI doesn't have such build number. Snapshot is as below. The first release run is submitted through portal and its name contains a build number (the redacted part). However, the second release run sumitted through az pipelins release create
doesn't contain build number part.
Our release pipeline has a "Release name format" setting as below:
New Release Train -$(Build.BuildNumber)-$(rev:r)
Describe the solution you'd like A clear and concise description of what you want to happen. e.g. If you want a new command to be added, what would it do?
The command should expose some parameter that allows me to pass instanceReference.name
so that the following payload can be constructed:
{"artifacts": [{"alias": "SomeAlias", "instanceReference": {"id": "1234567","name":"someBuildNumber"}}], "definitionId": 123}
Additional context Add any other context or screenshots about the feature request here.
Any news about this item? We have the same problem where the release names aren't created correctly. So without that, this is pretty useless.
az pipelines release create --artifact-metadata-list build=$BUILDID config=$CONFIGID --org $ORGANISATION --project $PROJECT --definition-id $RELEASE_DEFINITIONID
![image](https://user-images.githubusercontent.com/22151284/221802486-180812c7-0210-4f20-aca9-c22eeceee3f2.png)
However, when you don't specify for example the primary artifact (build in our case), it uses the latest buildId version, and then the release name is created perfectly:
az pipelines release create --artifact-metadata-list config=$CONFIGID --org $ORGANISATION --project $PROJECT --definition-id $RELEASE_DEFINITIONID
![image](https://user-images.githubusercontent.com/22151284/221803079-33ebdc52-05a7-48f1-bddf-5d25a3ef92b0.png)
I too would like to use this command so that I can create a useable release.