2
votes

Within Azure Logic Apps, is there any way to use JSON Schema validation on the HTTP Webhook callback body? Similarly to how JSON Schema is used on the HTTP Trigger "When a HTTP request is received".

Directly, it does not seem so.

A possible alternative would be to use a Parse JSON component afterwards, but that would not throw a HTTP error when calling the callback url.

Are there any other possible solutions?

1

1 Answers

1
votes

Currently, there is no option to do it directly on the Webhook callback. What you can do is to have an intermediate validator HTTP triggered Logic App (Webhook callback wrapper), that does the validation and then forwards the HTTP call to the actual Webhook callback only if valid.

To implement this, you would need to derive a new callback url that points to the intermediate validator Logic App, passing the instanceid in the CallbackUrl. Then you would need to reconstruct the full callback url at the wrapper logic app to forward the validated payload to the original Logic App instance.

You can get some insights on how to implement this Webhook callback wrapper in this post. In your case, as long as you can derive the original callback url on your wrapper/validator, you wouldn't need to store any correlation.

HTH.