0
votes

I worked to automate all the creation and setup of an Azure DevOps project from a PowerShell script using the Azure DevOps REST 6.0 API. I have ONLY ONE step left for the configuration to be fully automated ... This is the activation of the Continuous deployment trigger in the definition of a release pipeline ...

What I want to do

Is this a step that can be automated? Is there a way with the API?

Thank you for your answer ????

1

1 Answers

0
votes

If you look at the history tab after enabling continuous deployment via the UI, you will see the JSON you need to provide:

    "triggers": [
        {
            "triggerType": 1,
            "triggerConditions": null,
            "artifactAlias": "_MyArtifact"
        }
    ],

With a branch filter:

  "triggers": [
    {
      "artifactAlias": "_MyArtifact",
      "triggerConditions": [
        {
          "sourceBranch": "main",
          "tags": [],
          "tagFilter": null,
          "useBuildDefinitionBranch": false,
          "createReleaseOnBuildTagging": false
        }
      ],
      "triggerType": "artifactSource"
    }
  ],