xrm-ci-framework icon indicating copy to clipboard operation
xrm-ci-framework copied to clipboard

webhook Service Endpoint registration with querystring param

Open vcb-xrmvision opened this issue 4 years ago • 7 comments

Did you know how to add the query string parameters to a webhook registration?

I presume it's the parameter "AuthValue" but I'm unable to specify to correct format or find documentation. I tried standard query string format or json key value array without success.

I'm trying to update a web hook registration pointing to a Azure Function using function key . Format : [appservicename].azurewebsites.net/api/[functionnname]?code=[functionKey that varies on each envir]

vcb-xrmvision avatar May 22 '20 16:05 vcb-xrmvision

@vcb-xrmvision are you trying to do this with Powershell or the tasks?

WaelHamze avatar May 27 '20 05:05 WaelHamze

The end goal is with tasks but I tried both with the same result.

vcb-xrmvision avatar May 27 '20 11:05 vcb-xrmvision

@vcb-xrmvision have you tried the Service Endpoint Registration task with a json of this format? https://github.com/WaelHamze/dyn365-ce-devops-sample/blob/master/Sample/Xrm.CI.Framework.Sample/Xrm.CI.Framework.Sample.Plugins/ServiceEndpoints.json

https://github.com/WaelHamze/dyn365-ce-devops-sample/blob/master/Sample/Xrm.CI.Framework.Sample/Xrm.CI.Framework.Sample.Plugins/GetServiceEndpoints.ps1

You can generate the file using this script from your source environment and then replace any env specific values at runtime in the pipeline before the task.

WaelHamze avatar May 28 '20 06:05 WaelHamze

@WaelHamze thanks so much for your time yes I tried and it is working like a charm for service bus connection. The issue is for webhook service where I need to provide query string parameter or header

ex. https://myappservice.azurewebsites.net/api/myfunction?code=xxx

the portion "?code=xxx" can't be provided in the URL and I'm not able to find any documentation on the format to use for "AuthValue"

I saw in the sample your provided ... "AuthValue": "EchoCode",
... I simply need to understand the format of the value EchoCode

Thanks again

vcb-xrmvision avatar May 28 '20 08:05 vcb-xrmvision

@vcb-xrmvision I think if you are using WebhookKey as auth then the AuthValue would be the key.

If you are using querystring or header, it gets a little bit more complicated.

I did some network tracing the other day.

Can you try to populate the AuthValue with a string in the below format and let me know if it works for you?

<settings><setting name="key1" value="v1" /><setting name="key2" value="v2" /></settings>

WaelHamze avatar Jun 02 '20 17:06 WaelHamze

@vcb-xrmvision any luck with this?

WaelHamze avatar Jun 05 '20 05:06 WaelHamze

@WaelHamze I am a bit late to this but just to let you know this really helped us. The Auth Value set with the XML works a treat. Thank You.

schwoi avatar Mar 28 '21 20:03 schwoi