Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Inside Logic Apps


Published on

In this session, Stephen will walk through how you can use Azure Logic Apps to automate business processes without using code. He will demonstrate the new graphical designer, as well as speak to the architecture of the underlying system, and how to best take advantage of different Logic App capabilities.

Published in: Technology
  • Be the first to comment

Inside Logic Apps

  1. 1. tSponsors Stephen Siciliano Senior Program Manager, Microsoft Inside Logic Apps BizTalk Summit 2015 – London ExCeL London | April 13th & 14th
  2. 2. Agenda Introduction Background Basic scenario – WebHook initiated Logic App Taking it to the next level Repeats Conditionals Parameters
  3. 3. API APPS Easily build and consume APIs in the cloud WEB APPS Web apps that scale with your business LOGIC APPS Automate business process across SaaS and on-premises MOBILE APPS Build Mobile apps for any device App Service
  4. 4. LOGIC APPS Automate business process across SaaS and on-premises
  5. 5. Background
  6. 6. Azure Resource Manager The Azure Resource manager is a highly-scalable geo-distributed system that handles millions of resources across 100,000’s of subscriptions.
  7. 7. Same underlying engine… RESOURCE MANAGER Can handle thousands of parallel deployments per stamp Resilient against failure – retries with “at least once” guarantee Simple, declarative JSON template Automatically infers dependences between resources LOGIC APPS Can handle thousands of parallel runs per stamp Resilient against failure – retries with “at least once” guarantee Simple, declarative JSON definition Automatically infers dependences between actions
  8. 8. { "$schema": " preview/deploymentTemplate.json#", "contentVersion": "", "variables": { "myWorkerSize": 0 }, "parameters": { "siteName": { "type": "string" }, "hostingPlanName": { "type": "string" }, "siteLocation": { "type": "string" }, "sku": { "type": "string", "allowedValues": [ "Free", "Shared", "Basic", "Standard" ], "defaultValue": "Free" }, "workerSize": { "type": "string", "allowedValues": [ "0", "1", "2" ], "defaultValue": "0" } }, "resources": [ { "name": "myplan1", "type": "Microsoft.Web/serverfarms", "apiVersion": "2014-04-01-preview", "location": "West US", "tags": { "dept": "test" }, "properties": { "Name": "myplan1", "sku": "Free", "workerSize": "[variables('myWorkerSize')]", "numberOfWorkers": 1 } }, { "name": "[parameters('siteName')]", "type": "Microsoft.Web/sites", "apiVersion": "2014-04-01-preview", "location": "[parameters('siteLocation')]", "tags": { "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource" { "$schema": " preview/workflowdefinition.json#", "contentVersion": "", "parameters": { "keyword": { "defaultValue": "logicapps", "type": "string" } }, "triggers": { "twitterconnector": { "recurrence": { "frequency": "Hour", "interval": 1 }, "type": "ApiApp", "inputs": { "apiVersion": "2015-01-14", "host": { "id": "/subscriptions/423db32d-4f58-4220-961c- b59f14c962f1/resourcegroups/bpmdemo003/providers/Microsoft.AppService/apiapps/twitte rconnector", "gateway": "" }, "operation": "TriggerOnNewTweet", "parameters": { "triggerId": "@workflow().name", "parameters": { "callbackUrl": "@accessKeys('default').primary.secretRunUri", "inputs": { "Keywords": "@parameters('keyword')" } } }, "authentication": { "type": "Raw", "scheme": "Zumo", "parameter":
  9. 9. … more power RESOURCE MANAGER 8 functions for basic referencing and string functions Can only PUT resources into resource groups Auth must be through AAD Triggered manual through API LOGIC APPS Over 50 functions from string manipulations to math, to sets operations, to logical operators All HTTP operations supported on any arbitrary endpoint Supports many OAuth providers, AAD, Cert auth, or Basic auth 4 different ways to be triggered
  10. 10. Basic scenario Using WebHooks to start a workflow
  11. 11. User adds an item to a list in their Mobile app Mobile app has the callback URI for the workflow When the callback URI is called, the workflow immediately starts the “first*” action All dependent actions in the workflow continue as normal
  12. 12. Actions with simple orchestration 3 ways to introduce dependences between actions: 1. Implicitly – whenever you reference the output of an action you’ll depend on that action executing first 2. Explicit “dependsOn” condition – you can mark certain actions to run only after previous ones have completed “dependsOn” : “twitterconnector” 3. Explicit “expression” condition – a complex function that evaluates properties of other actions “expression” : “@equals(actions(‘twitterconnector’).code, ‘InternalServerError’)”
  13. 13. Actions that run in parallel will
  14. 14. Triggering a Logic app “Run” Recurring schedule – “every X hours” Polling an API for a response A 200 response means “run” -- a 202 response means “wait” Can use trigger state to get information on the previous execution Registering an API App to “push” to a workflow Using a custom contract implemented for API Apps WebHook Every workflow has an endpoint you can POST to from any web service Supports Basic auth for simple systems Manually User can click the “Run Now” button in the portal
  15. 15. The Next Level
  16. 16. Repeating Loop a single action over a list of items Runs the action N times You can get at all of the statuses for each action Tip: when you have multiple collections use: "repeat" : "@range(0,length(body('connector1')))" … "inputs" : "@concat(body('connector1')[repeatItem()], body('connector2')[repeatItem()])"
  17. 17. Conditionals Logic on a trigger or action For triggers conditionals are post- conditions For actions conditionals are pre-conditions You can do conditionals inside of repeats to perform as a filter
  18. 18. Parameters Dev Workflow Prod Workflow Definition Declares parameters Uri: @parameters (‘endpoint’) Definition (identical) Declares same parameters Uri: @parameters (‘endpoint’) Parameters Provides DEV config Endpoint : “http://int.mysite.n et” Parameters Provides PROD config Endpoint : “” • Re-using values, or even complex objects, throughout the definition, which makes it easier to comprehend • Separate out config from the definition itself, making sharing easy, as well as across different environments.
  19. 19. Messages Large message support is built-in (<100 MB) To handle binary blobs of data you can: 1. Externalize state (save it to Azure storage) 2. Base64 encode it and return it directly in the workflow (workflows are JSON) All messages are archived Retention period depends on the App Service plan
  20. 20. Debugging tips Try calling the API App directly: POST {gatewayURI}/api/service/invoke/{api app name}/{operation name}?api-version=2015-01-14 x-zumo-auth : {your token} This may be a faster way to iterate if you are seeing failures Use to debug triggers – you can inspect all incoming requests Enable logging for the Web app hosting the API App *New* you can Cancel a Run if it is failed
  21. 21. Q&A