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.
In this example we will create a very simple workflow which has following steps
- Trigger the workflow every 1 hour
- GET the weather data for the current location
- 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
- Enter details
- Create workflow in logic app designer
- Recurrence connector lets you schedule the run. In this case we are triggering the workflow every 1 hour.
- Add an HTTP connector which will call the weather api (OpenWeatherMap api) and get the weather data for current location
- 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.
- 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 ;-)).
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.
- Redirecting Standard Error for a .NET application
- Using azure active directory authentication in your web application