Hi all, We tried to set-up a webhook to trigger a...
# pact-broker
b
Hi all, We tried to set-up a webhook to trigger an Azure devops pipeline. we used the template found here https://docs.pact.io/pact_broker/webhooks/template_library#azure-devops---trigger-build. Now we want to test the webhook, we tried it via the broker CLI the HAL browser and postman, but in al cases we get this error from Azure.
Copy code
"body": {
            "$id": "1",
            "innerException": null,
            "message": "A value for the 'provider_app_version' parameter must be provided.",
            "typeName": "Microsoft.Azure.Pipelines.WebApi.PipelineValidationException, Microsoft.Azure.Pipelines.WebApi",
            "typeKey": "PipelineValidationException",
            "errorCode": 0,
            "eventId": 3000
        }
How do we sent this data when making a test call?
This is how the webhook looks like in the HAL browser
Copy code
"request": {
  "method": "POST",
  "url": "<https://azure/_apis/pipelines/1/runs?api-version=7.1-preview.1>",
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "**********"
  },
  "body": {
    "resources": {
      "repositories": {
        "self": {
          "ref_name": "refs/heads/master"
        }
      }
    },
    "template_parameters": {
      "pact_consumers": "${pactbroker.consumerName}",
      "pact_url": "${pactbroker.pactUrl}",
      "provider_app_version": "${pactbroker.providerVersionNumber}",
      "provider_name": "${pactbroker.providerName}"
    }
  },
m
I guess temporarily you could fill in real values in for the test button, and replace with the templated ones once you’re happy?
@phanindra srungavarapu do you know if the template values are replaced with “fake” ones during the test execution?
b
okay, will have a try, tnx
👍 1
m
Reading the code, it looks like it tries to use the latest pact and verification as the source for data: https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/webhooks/trigger_service.rb#L31-L41
👍 1
b
Thanks for you re replies, we found the error at our side in the end.
👍 2