Share via


Using Logic Apps Webhook Triggers

We were excited to share yesterday in our webcast that you can now start using HTTP Webhook triggers in Logic Apps.  In the new designer the manual trigger will have its own option and display, but you can start building HTTP Webhook triggers today.  Here's how:

Creating an HTTP Webhook Trigger

Create a Logic App and create a "manual trigger."  This is different than just clicking the "run this manually" checkbox, and in the current designer it requires writing within codeview.  Here's what the manual trigger looks like:

 {
 "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2014-12-01-preview/workflowdefinition.json#",
 "contentVersion": "1.0.0.0",
 "parameters": {
 "runworkflowmanually": {
 "defaultValue": true,
 "type": "Bool"
 }
 },
 "triggers": {
 "manual": {
 "type": "Manual",
 "inputs": {
 "schema": {
 "type": "object",
 "required": [],
 "properties": {}
 }
 }
 }
 },
 "actions": {},
 "outputs": {}
 }

Getting the CallbackURL

Once you have created the Logic App with the correct manual trigger, now you just need to retrieve the callback URL.  In the future this will be possible from within the portal, but today it requires a call to the REST API.  Here's what the call looks like:

 POST
 https://management.azure.com/subscriptions/{subId}/resourcegroups/{resourceGroup}/providers/Microsoft.Logic/workflows/{LogicAppName}/triggers/{triggerName}/listcallbackurl?api-version=2015-08-01-preview
 Headers: Authorization

In the example above, the triggerName would be "manual"

That's it - you should get back a response that contains a URL you can now use to trigger your Logic App.  Even better this link is de-coupled from the resource group, so moves to different groups will still result in valid triggers.