Azure Logic apps is Microsoft Azure’s Integration and Work flow offering in the Cloud. Azure Logic apps directly competes with existing Integration and Workflow cloud offering such as Amazon’s Simple Workflow Service. It also offers a more lightweight alternative to more heavyweight Enterprise solutions such as Microsoft BizTalk, Oracle fusion or Mulesoft. If you are SMB or event larger Enterprise then Logic Apps offers a solution to automating business processes/workflows which you may have been developing bespoke Applications for.
Azure logic Apps is essentially a workflow engine in the cloud. The Cloud based service is part of Microsoft Azure’s App service Paas offering. Unlike developing custom bespoke workflow applications Azure Logic apps comes out of the box with features such as:
Like any workflow engine Azure Logic Apps provides numerous connectors which can be used when building your workflow. For a comprehensive list of connectors see: https://docs.microsoft.com/en-us/azure/connectors/apis-list
Essentially Logic Apps are composed of two key components:
To achieve this Azure Logic Apps makes use of the concept of connectors. Connectors are hosted services which allow to access events, data, and actions across numerous services, Apis and platforms. An example would be a connector to Twilio SMS service if you want to integrate your workflow with SMS messaging.
The power of connectors is that they can be used as a trigger as well as an action.
Next we will demonstrate a simple example of creating a basic Logic App. The scenario will demonstrate receiving an e-mail notification when an upload of a txt file occurs to a folder in your personal “One drive”. This example will demonstrate the concept of setting up a connector and a basic workflow with simple rules to decide on what to do when a trigger occurs.
Login to the Azure portal https://portal.azure.com/
Select New from the left hand menu. In the search bar enter Logic App. Hit Enter.
On the next screen click create. This will bring up the Create logic app blade.
Azure app services require a Resource Group to be specified. A resource group is the basic logical container for any deployment in the new Azure portal deployment model (ARM). You can specify an existing or new resource group. Specify a location for the resource group. Click on create. Azure will now create a Logic App.
Logic apps are created using the Azure Portal Logic App designer. Once your Logic app has been created click on the “Logic App Designer” item in the left hand pane under the heading “Deployment Tools”. This will bring up the designer.
As can be seen from the above screenshot the designer comes with preconfigured template triggers to get you started. In this example we want to build a workflow from scratch so select the “Blank logic App”. This will load the search connectors/triggers screen.
In the search bar type “OneDrive”. A list of connectors will appear. Select “OneDrive” (not OneDrive for business). You will now be asked to login. Login and accept the permissions you are allowing Logic app to access. Once you have done this another screen will appear asking you which trigger you want to select.
Select “OneDrive – When a file is created” option. This will bring up the next screen where you choose your file watch options:
In this example I have selected the OneDrive folder “Personal”. Feel free to select any folder you want to watch. Leave the other options with their default values.
The next part of the workflow is to send a notification e-mail using your personal g-mail. Click on “New step”. Type “Send email” in the search bar of the new step. Select g-mail. You will be asked to sign in to give authorization to your Logic app for your g-mail account.
In the send e-mail step fill in the Send-email form. Enter the “To” address field. Enter a valid e-mail address to send the notification to. Notice to the right of the “Send email” form is a popup window. This allows you to select dynamic metadata from the file to be part of your e-mail. In the screenshot above you can see you have the following options to select from:
In this example we will use the “File name” property. In the Subject field enter the text “The file” then select the “File Name” metadata from the “Dynamic content” tab of the popup window. After selecting the metadata add the rest of the line “was uploaded to your personal folder”.
As well as adding Dynamic content you can use a rich set of Expressions from the “Expression” tab:
You can select from a rich set of expressions that include: String functions, Collection functions, Logical functions and more. For a full selection of functions please visit the URL: https://docs.microsoft.com/en-gb/azure/logic-apps/logic-apps-workflow-definition-language
Save your workflow in the designer by clicking on the “Save” icon at the top of the designer screen.
For more logical operations you can set conditions on a step. This is where you can define logical conditions on what to do before calling a specific action. Click on “New step” after creating the first action.
Select add a condition:
As can be seen from the above screenshot Logic apps provides both conditional operators and dynamic expressions to write logic to perform an action. In the above example a file name is checked to be equal to a specific named file.
Testing your workflow. To test simply create a text file in your personal one drive. For this example I have uploaded an empty text file called sample.txt into the Personal folder. The workflow is configured to check every 3 minutes. You can additionally select the run link at the top of your Designer view. Click on the Run link. This will execute the workflow.
If your workflow is successful then you should receive an e-mail with the subject line:
The file sample.txt was uploaded to your personal folder
As you can see the logic app has inserted the File Name into the subject text.
To monitor the success or failure of your workflow you can select the “Overview” link on the left hand pane of your Logic App.
This will load the overview blade. This blade shows the status of your workflow runs. You can select on a run to see further details.
Once selected a screen will load showing the overall status of the workflow.
As the above screenshot shows each trigger/action is shown with a tick.
For common integration scenarios Azure Logic Apps provides a rich set of connectors and triggers. However, for more enterprise B2B scenarios that involve more complex data flows, protocols and data interchange formats such as xml then a more advanced approach is required.
Now available for Azure Logic Apps is the ability to build Logic Apps with its new Enterprise Integration pack. This supports the following features:
Before you can start creating your complex B2B integration work flows there are a few prerequisites steps you must follow. Using Azure Enterprise Integration pack requires you to create the following:
An integration account can contain the following types of artifacts:
Visual Studio 2015 comes with an extension called Enterprise Integration Tool. This extension adds new Integration project template. This allows integration developers to define:
The key benefit of this project template is it provides IDE experience for creating the key artifacts that can be uploaded to your Azure Logic App Enterprise Integration account.
Once you have defined your message schemas, as with all Enterprise integration scenarios you will want to build your Enterprise workflow. The Enterprise Integration Pack provides a suite of connectors to choose from:
The enterprise connectors shown in the screenshot above cover both EDI and standard Flat file processing capabilities.
For more hybrid scenarios, Azure Logic app offers integration with existing on premise data sources using the on premises data gateway. The on premise gateway provides a secure channel for transferring data from your on-premises data sources. It currently supports the following sources:
For further details of setting up a on premises gateway please visit he Azure documentation for a more detailed walkthrough: https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-gateway-connection
Azure Logic apps offers an attractive solution for SMB or even larger enterprises to build cloud based business workflows. Furthermore, with the addition of the Enterprise Integration pack it is now possible to build B2B integration workflows in the Cloud. Companies can create an Integration account to store their key B2B artifacts. This then allows developers to build more complex B2B workflows using the available connectors. This can then be further extended to hybrid scenarios where data sources are on premise using the “On premise data gateway” in Azure.