1

I don't know if is already released az devops extension to create pipeline release with AZ CLI. There are post relating to 1y ago. I found documentation here but I can't understant how to create various stage of release pipeline.

https://learn.microsoft.com/en-us/cli/azure/ext/azure-devops/pipelines/release?view=azure-cli-latest#ext-azure-devops-az-pipelines-release-create

Someone has already created release pipeline with yaml and tell me how please? Or just post some command to import into Azure-DevOps project?

Cyber.Drunk
  • 165
  • 2
  • 12

1 Answers1

0

For this issue , right now there is no way to automate the creation of classic release definition. You will need to create the definition and then you can queue a Release run using az pipelines release create command.

The role of az pipelines release create command is to kick off a new release for an existing release pipeline, not to create a new release pipeline.

You can refer to this issue on github about this.

So as a workaround , it is possible to automate the new yaml pipeline definitions with az pipelines create command which can constitute both build (CI) and release (CD).

First you can create a yaml file(e.g. azure-pipelines.yml) in the repo and set the definition for both CI and CD pipelines in the yaml file. YAML schema reference can give you guidance.

Then you can create an Azure Pipeline for a repository with the pipeline yaml already checked in into the repository via az pipeline create command. Specify --yaml-path in the command.

--yaml-path --yml-path :

Path of the pipelines yaml file in the repo (if yaml is already present in the repo).

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
  • Thank you for your answer. Yes I'm already using yaml path in the repo for automate creation of CI and CD Build Pipelines. For release I export from another project the JSON file and import in the new one, but then I need to set up all the variable for the new project and authorize task to my subscription just want to automate also this task – Cyber.Drunk Apr 10 '20 at 23:02
  • Service connections are only available at project level. If you want to authorize tasks to subscribe in another project, I think this cannot be achieved automatically. – Hugh Lin Apr 13 '20 at 10:16
  • @Cyber.Drunk Not get your response for several days, service connections are created at project scope. A service connection created in one project is not visible in another project. You can refer to this [document](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml) about this. If this answer is helpful to you,would you please accept it as an answer?Or if you have any concern, feel free to share it here. – Hugh Lin Apr 19 '20 at 15:23