logic apps and powerapps - integrate across your apis
TRANSCRIPT
Sponsored & Brought to you by
Logic apps and PowerApps – Integrate across your APIsStephen Siciliano
http://www.twitter.com/iscsus
https://www.linkedin.com/in/ssiciliano
Logic apps and Power Apps – Integrate across
your APIsStephen Siciliano, April 2016
Agenda• Background• Visualizing your flow• Triggering Logic apps• Connect to your APIs• Building a Business app• What if you need code?• Q & A
Background
Democratize Development
Vision:
Platform Leader
RichEcosystem
Platform Value
flexible business solutions, delivered quickly –without the time and cost of
custom software development
Or…
Clicks, not code
Businesses need to deliver that flexibility in a way that stays extensible, connected, secure and
scalable
AUTOMATE
Logic AppsACT
PowerApps
Connectors to Data and APIs
Connect and automate common tasks with Logic Apps
Use simple, intuitive tools
Create crucial, reliable tasks without coding
Integrate your mobile and web-based apps
Connect existing apps to SaaS services
BizTalk APIs for expert integration scenarios
Visualizing your flow
Designer feature improvements • Much better control flow handling• More visual way to populate parameters than before • New swagger (OpenAPI) extensions• Dynamic content without dynamic swagger• Folder browsers
Long term goal: don't require code view for any features
Control flow in the designer
Response For Each Split On Do UntilConditions
EXPLICIT IN THE UI IMPLICT IN THE UI COMING SOON
DemoControl Flow in the DesignerDynamic Content
Dynamic content in the designerWorks by specifying another API to call for the contentx-ms-dynamic-values• For dynamic dropdowns (static dropdowns can just use an
enum)x-ms-dynamic-schema• In SharePoint or SQL, the columns vary from table-to-table• Rather that define all possible tables in swagger, you expose an
endpoint to get the JSON schema on• Swagger can be public, allowing searching / indexing
https://azure.microsoft.com/en-us/documentation/articles/powerapps-develop-api/
Triggering Logic apps
Triggering from your APIs
Webhooks• Preferred way to trigger a
workflow• Instantaneous• Highly scalable• Your API needs to
implement 2 methods:1. Subscribe2. Unsubscribe
Polling• Fallback if you’re
shimming an existing API• Much chattier and laggier• Need to add 2 headers:
1. Retry-after2. Location
• Two options: 202-async or batched
WebhooksSubscribe
Called whenever the Logic app is created/enabledUse the @listCallbackUri() function to get the endpoint of the trigger to pass to the backing servicePass whatever content you want in the body
UnsubscribeCalled when the Logic app is delete/disabledUse the @triggerOutputs().subscribe object to get values from the subscribe (e.g. the id of a webhook)
Polling triggersRetry-after header used to tell the engine when to poll again
Retry-after 60
Location header to tell the engine where to poll next• Use the Location header to store some watermark• E.g. for an OData endpoint return: Location https://{orig endpoint}?$filter=_createdTime gt {utcnow}
x-ms-trigger: single• Returns 200 when there is
trigger payload• Returns 202 when not
x-ms-trigger: batched• Return an array to split on• Can return an empty array if
you don’t want to trigger
Using async in the middle of your Logic app• The async operations you define (webhook or polling)
can both be used inside of an action• Think of the "when a file is added" api. You can create a
workflow to:• Whenever a new case is opened in CRM • Send an email asking for the details to be put into a doc in a
folder • When a file is added to the folder • Attach to the case in CRM and close it
Using a Logic app as an HTTP endpoint• Easily create APIs to call that
orchestrate across 1 or more other services• You have full control to define
the body of the response• You can have as many response
shapes as you need
Connect to your APIs
Easily use cloud or custom APIs:• Dozens of built-in APIs for popular
SaaS
• An ecosystem of APIs for any need
• Create and publish custom, reusable APIs
• Easily connect to existing APIs in the cloud
• Visual Studio tooling with one click publish and remote debugging
Create, consume andhost APIs more easily
API’S
Different levels of integration• HTTP action
• Manually define all of the parts of the request (URI, method, body payload)
• HTTP + Swagger action• Paste in your swagger’s endpoint• Needs to be CORS enabled and
unauthenticated• App Services deployed in your subscription
• Same requirements for the swagger• Easy auth to protect the API • Auto-discovers the operations
• "API connections"
API connection action type• Managed APIs• OOB APIs hosted by Logic
Apps• Serviced by the product team• First class designer experience• Rapid development
• Custom and External APIs• First class designer experience
using Swagger• Auto discovery of Azure hosted APIs• Declaratively reference an External
API• Raw HTTP request for all other
API• API Connections• Authenticate once and re-use• Differentiate connection
configuration• Simple to deploy
DemoCustom APIs
Building a business app
• Easily create mobile-optimized applications• Connect to your data where it
resides, access a wide variety of data sources, from SharePoint lists to Excel files• Integrate apps with larger processes; trigger workflows across your Enterprise based on user actions
PowerApps
DemoBuilding a business app
What if you need code?
Azure Functions• Very easy way to host small snippets of code that run
some logic• Supports all of the App Service languages • Native integration inside of Logic apps
Q & A