Skip to content

Instantly share code, notes, and snippets.

@pacodelacruz
Last active October 10, 2017 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pacodelacruz/0316be0b7b29f8ca17db5b06492e81f1 to your computer and use it in GitHub Desktop.
Save pacodelacruz/0316be0b7b29f8ca17db5b06492e81f1 to your computer and use it in GitHub Desktop.
{
"$connections": {
"value": {
"servicebus": {
"connectionId": "/subscriptions/94c0de1a-1234-4854-8b7e-c8ff07fc8888/resourceGroups/my-rg/providers/Microsoft.Web/connections/servicebus",
"connectionName": "servicebus",
"id": "/subscriptions/94c0de1a-1234-4854-8b7e-c8ff07fc8888/providers/Microsoft.Web/locations/australiasoutheast/managedApis/servicebus"
}
}
},
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"HTTP": {
// Fixed values are replaced by Logic Apps parameters, i.e. @parameters()
"inputs": {
"authentication": {
"password": "@{parameters('endpointPassword')}",
"type": "Basic",
"username": "@{parameters('endpointUsername')}"
},
"body": "@base64ToString(triggerBody()?['ContentData'])",
"method": "POST",
"uri": "@{parameters('endpointUrl')}"
},
"runAfter": {},
"type": "Http"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
// Logic App Parameters Definition
// Default values are only required when defining them at Development time.
// If deployed from an ARM Template, default values are not required.
// When defining Logic Apps parameters, we use the same syntax as the one used for ARM Templates,
// but within the Logic App definition.
"parameters": {
"endpointPassword": {
"defaultValue": "u1tr@53cr37+dev",
"type": "string"
},
"endpointUrl": {
"defaultValue": "https://mysupercoolendpoint-dev.com.au/service/",
"type": "string"
},
"endpointUsername": {
"defaultValue": "username-dev",
"type": "string"
}
},
"triggers": {
"When_a_message_is_received_in_a_queue_(auto-complete)": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['servicebus']['connectionId']"
}
},
"method": "get",
"path": "/@{encodeURIComponent('myqueue')}/messages/head",
"queries": {
"queueType": "Main"
}
},
"recurrence": {
"frequency": "Minute",
"interval": 3
},
"type": "ApiConnection"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment