1

I have an azure devops pipeline where I declare the following parameter:

parameters:
  - name: extra_tags
    displayName: Extra tags to add
    type: object
    default:
      foo: "bar"
      two: "three"

And it fails when I to trigger the pipeline via Http REST with the following body:

{
    "resources": {
        "repositories": {
            "self": {
                "refName": "refs/heads/main"
            }
        }
    },
    "templateParameters": {
        "extra_tags": {
            "1": "one",
            "2": "two"
        }
    }
}

If I remove the extra_tags, it works, since I declared the default, has anyone faced such problem?

Renm
  • 717
  • 3
  • 10
  • 20
  • Does this answer your question? [Azure DevOps YAML Pipeline Parameters Not Working from REST API Trigger](https://stackoverflow.com/questions/60852825/azure-devops-yaml-pipeline-parameters-not-working-from-rest-api-trigger) – ddastrodd Jul 14 '22 at 23:58

1 Answers1

1

Please try using the following Request body:

{
    "resources": {
        "repositories": {
            "self": {
                "refName": "refs/heads/main"
            }
        }
    },
    "templateParameters": {
        "extra_tags": "1: one\n2: two"
    }
}
Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55