We have a number of new feature in Logic apps and PowerApps that make it easier than ever to build workflows that orchetstrate across any RESTful API. We will cover some of the latest updates to Logic apps and PowerApps.
Logic apps and PowerApps - Integrate across your APIs
1. Sponsored & Brought to you by
Logic apps and PowerApps –
Integrate across your APIs
Stephen Siciliano
http://www.twitter.com/iscsus
https://www.linkedin.com/in/ssiciliano
2. Logic apps and Power Apps –
Integrate across your APIs
Stephen Siciliano, April 2016
3. Agenda
• Background
• Visualizing your flow
• Triggering Logic apps
• Connect to your APIs
• Building a Business app
• What if you need code?
• Q & A
9. 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
11. 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
12. Control flow in the designer
EXPLICIT IN THE UI IMPLICT IN THE UI COMING SOON
14. Dynamic content in the designer
Works by specifying another API to call for the content
x-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/
18. Triggering from your APIs
Webhooks
• Preferred way to trigger a
workflow
• Instantaneous
• Highly scalable
• Your API needs to implement
2 methods:
1. Subscribe
2. Unsubscribe
Polling
• Fallback if you’re shimming an
existing API
• Much chattier and laggier
• Need to add 2 headers:
1. Retry-after
2. Location
• Two options: 202-async or
batched
19. Webhooks
Subscribe
Called whenever the Logic app is
created/enabled
Use the @listCallbackUri() function to
get the endpoint of the trigger to pass to the
backing service
Pass whatever content you want in the body
Unsubscribe
Called when the Logic app is delete/disabled
Use the @triggerOutputs().subscribe
object to get values from the subscribe (e.g.
the id of a webhook)
20.
21. Polling triggers
Retry-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
22. 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
23. 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
25. 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 and
host APIs more easily
API’S
26. 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"
27. 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
•
30. • 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
33. 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