workflow all the things with azure logic apps

29
Azure Logic Apps Josh Lane Azure Content Lead – Cloud Academy Ian Philpot Senior Developer Evangelist – Microsoft

Upload: josh-lane

Post on 24-Jan-2018

488 views

Category:

Software


3 download

TRANSCRIPT

Azure Logic Apps

Josh Lane

Azure Content Lead – Cloud Academy

Ian Philpot

Senior Developer Evangelist – Microsoft

What the what?

• Integration PaaS

• Declarative, trigger-based workflows

• Hosted in Azure

• JSON-based

• Pay per workflow step executed• Starts at $0.0008/step

Logic Apps

Connect Anything

Agile Business

Transform Business

Cloud APIs and platform functionality

API connections

Managed connectors

Protocols/Native

XML & EDI

Hybrid

Spectrum of connectors

SaaS

Protocols/Native

XML & EDI

Hybrid

Spectrum of connectors

SaaS

• Azure API Management

• Azure App Services

• Azure Cognitive Face API

• Azure Cognitive LUIS

• Azure Cognitive Text Analytics

• Azure Document DB

• Azure Functions

• Azure Machine Learning

• Azure Resource Manager

• Azure Service Bus

• Azure SQL

• Azure Storage Blob

• Azure Storage Queues

Protocols/Native

XML & EDI

Hybrid• BizTalk Server

• SharePoint Server

• SQL Server

Spectrum of connectors

SaaS

• Bing Search

• Dynamics AX Online

• Dynamics CRM Online

• Dynamics CRM Service Bus

• Dynamics Financials

• Dynamics Operations

• Microsoft Project Online

• Microsoft Translator

• MSN Weather

• Office 365

• Office 365 Users

• Office 365 Video

• OneDrive

• OneDrive for Business

• OneNote

• Outlook.com

• Outlook Tasks

• Power BI

• Project Online

• SharePoint Online

• VS Team Services

• Wunderlist

• Yammer

Workflow in the cloud

Powerful control flow

Connect disparate applications

No code designer for rapid creation

Templates

Debugging and History

Trigger history / Run history

Monitoring view

Diagnostics & Alerts

Call Logic App on new Alert

Azure

•Hosted Logic Apps designer

• Persist using deployment templates

• Source Control & CI/CD

•Cloud Explorer extension

• Integration Account configurability

•Develop XML collateral• XSLT Mapper

• XML schemas

• Flat file schemas

Logic Apps tools for Visual Studio

Workflow Constructs

Triggers

Creates new instances of Logic Apps

• Runs based on a defined schedule.Recurrence

• Serves as an endpoint that you call via an HTTP Request.Request

• Poll a specified endpoint and check the response in order.HTTP

• APIConnection is a polling trigger that calls Managed connectors.APIConnection

• Calls out to a specified URL to register and unregister.HTTPWebhook

• Is a webhook trigger that subscribes to a webhook from a managed connector.

ApiConnection

Webhook

•Debatch an array into separate instances.Split

• Allow only one instance of a Logic App to run at a timeSingleton

Actions

Invoke other services

Managed Connectors

App Service APIs

API Management

Azure Functions

Workflow

HTTP + Swagger

HTTP

Actions

Control

behaviour

Retry Policy

Run After

Response

Webhook

Wait

Terminate

Actions

Message

Handling

Compose

Query

Request schema

Parse JSON

Xpath

XSLT

XML validation

Actions

Collections

• Encapsulates a set of actions.

• Can be used for error handling and compensation.

Scope

• If…Else conditions

• Can be nestedCondition

• Determines which path to take based on

values in case statementsSwitch Case

• Iterate over a list of items.ForEach

• Loop until a condition is met.

• Exit criteria can be time or condition.Until

Expressions

Built-in functions

• Concat; Substring; Replace; Guid; toLower; toUpperString

• Equals; Less; lessOrEquals; lessOrEquals; greaterOrEquals; And; Or; Not; IfLogical

• Int; String; Json; Float; Bool; Coalesce; Base64; Xml; XPath; EtcConversions

• Add; Sub; Mul; Div; Min; Max; Range; RandMath

• Utcnow; Addseconds; Addminutes; Addhours; Adddays; FormatDateTimeDate

• Contains; Length; Empty; Intersection; First; Last; Take; SkipCollection

• Parameters; Action; Actions; Triggers; ActionsOutput; ActionBody; Item; EtcReferencing

Expressions

Operators

• Invoke an expression function@

• Parameters for an expression()

• Array reference

• Property reference[]

• String interpolation{}

• Property reference.

• Null safe dereference?

Patterns

Workflow Patterns

• Use Service Bus to send the metadata

• Use Blob Storage to store the messages

• Include only the necessary metadata in the queue for routing

• Put related actions into a “try” scope

runafter try-scope Failed

• Add error handling actions into “finally” scope with a terminate action

• Use transport that provides ordered delivery (e.g. Service Bus queues)

• Use Singleton workflows

• Remove parallelism from foreach

In-Order Processing

mytrigger

type ApiConnection

inputs

recurrence

operationOptions singleInstance

forEach_item

type foreach

foreach @body('action1')

actions

operationOptions sequential

runAfter

Scalability

• Trigger uses long polling

• For immediate firing *minimum* polling interval should be 30 seconds

• Throttled at 2000 actions/min

• Use multiple Logic Apps sharing connection

• Use multiple connections

• Each Trigger can receive multiple messages in ‘batch’

Best Practices

• Allows for reuse

• Resubmit at appropriate granularity

• Increased parallelizability

• Check to see if there’s a built-in function

• Fall back to an Azure Function

• Request triggers are operations on an API

• Allows for vanity names, heterogenous APIs, telemetry, load balancing

• Consistent management of all API endpoints

• Works across VNETS

Thanks!