Orchestrating business workflows using Azure logic apps.

Azure has multiple offerings in its App services category which can help you leverage Azure’s Platform as a Service (PaaS) capabilities.

  • Web Apps – For web applications
  • Mobile Apps – For mobile backend
  • API Apps – For REST APIs
  • Logic Apps – For Integration and Automating business processes
  • Function Apps – For event driven execution of code

In this post I am going to talk about basics of Logic apps which is a very powerful way of automating your processes without writing much code.To learn more about other PaaS offerings from azure refer this pluralsight course on introduction to azure app services.

Azure Logic Apps

Logic Apps provide ability to create visual workflows using various components which can orchestrate a business process or integration workflow.Lets look at few core concepts for Logic Apps.

  • Connectors : Connectors provide you access to services and data which you would need in your business processes. E.g. a database,an API or something like dropbox,onedrive,google calendar etc. Refer the full list here.
  • Triggers : These are events which can kickstart your workflow.Imagine something like an email or something gets added to a database, an HTTP POST to an API , file added to dropbox etc. Your connectors can also act as triggers.
  • Conditions : As name suggest these are the steps where you can evaluate a condition e.g. take the output of previous step and check it for particular coditions.And there can be differnt actions taken if condition evaluates to true or false.

Lets look at one example to make this more clear.

Example

 

In this example we will create a very simple workflow which has following steps

  1. Trigger the workflow every 1 hour
  2. GET the weather data for the current location
  3. If data says that its going to rain then send an SMS on my phone.

To create a logic app you can go to Azure portal and add new logic app with all the details required as shown in below image.

  • Add new logic app

Create new logic app

  • Enter details

details

  • Create workflow in logic app designer

logic app workflow

  • Recurrence connector lets you schedule the run. In this case we are triggering the workflow every 1 hour.

recurrence

  • Add an HTTP connector which will call the weather api (OpenWeatherMap api) and get the weather data for current location

http connector

  • Add a new condition which takes as input the json data returned by the API in previous step and checks if it contains word “Clouds” (you can add more sophisticated logic :-) ).Based on the outcome of the condition we can have one of the actions executed.In this case if outcome is ‘Yes’ then It will execute a Twilio connector which will send an SMS.

condition

  • Once the workflow is triggered and the area is cloudy I get an SMS saying “Looks like its going to Rain” (I wrote the blog when it was really cloudy here ;-)).

sms

 

This is a very simple example but gives an idea of how it can be used for much larger business processes.

For example this can be extended to make a full fledged app which subscribes users based on their locations and send them various kinds of alerts based on weather , traffic etc.

Tagged on: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>