Azure Logic Apps - Twitter Integration For Trends Mail Notifications

Azure Logic Apps is Azure App Service Integration offering IPaaS (Integration Platform-as-a-Service). Logic Apps provide simple way to implement scalable integration and workflow in cloud using triggers and actions. It provides number of connectors through which you can connect with various applications and connect to On-premise data as well. Logic Apps can automate business process with connector and actions without writing code.

There are many connectors across the cloud and on-premises to quickly integrate across Services and protocols. A Logic App begins with a trigger and after firing, can begin many combinations of actions, conversions, and condition logic.

Need of Logic Apps

For integration with different applications and environment, traditionally, industry professionals always preferred BizTalk; however, it is very difficult for new developers to learn and implement it. In case of simple integration scenario, customers need to setup BizTalk and moreover, it will take more time as compared to Logic apps. Logic App is designed in such a way that it will simplify the integration with number of ready connectors and user doesn’t need to write code for that.

In simple scenarios where we need to do integration with on-premise data or custom API, we can do it in very less time.

 Logic App's Key Components

  • Workflow
    Logic App provides the graphical way to model your business process as service of steps.

  • Managed Connectors
    Logic apps need access to data and services. Connectors privileges the connection with the data. Large number manage connectors available for logic apps.

  • Triggers
    These are the connectors which act as trigger. These are useful to start new workflow based on a specific feature.

  • Actions
    Action is workflow step after trigger, each action mapped to your manage connector or custom API apps.

  • Enterprise Integration
    In advanced scenarios, logic app has capabilities with BizTalk. The Enterprise Integration Pack connectors allow you to easily include validation, transformation, and more into your Logic App workflows.

Capability

Logic apps have the following major advantages

  • Save time by designing complex processes using easy to understand design tools.
  • Implementing patterns and workflows seamlessly, that would otherwise be difficult to implement in code.
  • Getting started quickly from templates.
  • Customizing your logic app with your own custom APIs, code, and actions
  • Connect and synchronize disparate systems across on-premises and the cloud
  • API Management, Azure Functions, and Azure Service Bus with first-class integration support.
  • It has General Availability
  • Native capabilities
    1. Logic App has a native capability of Auditing which helps you track all the activities going on. You can track resources that have been changed in your service.

    2. Second native capability of logic apps is role base access control. We can grant specific access to specific person.

    3. Third native capability is API and PowerShell that allow you to run things through command line. It also allows create, delete and manage Azure resources by creating script.
  • Easy Implementation
    Logic App is easy to implement. It has visual designer rapid application creation, it will provide an easy way to do integration in cloud and automate it without writing single line of code.

  • API Support
    It has a large number of API supports and also we can consume these APIs very easily. It also has lots of pre-build and receipts you can use.

  • Scale
    Scaling is one of the main feature of logic apps. You will be able to deliver apps at massive scale from having tens to millions of concurrent users at the same time. With all this, you will be able to engage your customers at scale.

  • Large number of ready Templates
    We have large numbers of ready templates that allow you to rapidly create some common solutions. From advanced B2B solutions to simple SaaS connectivity, and even a few that are just 'for fun' - the gallery is the fastest way to get started with the power of Logic Apps.

  • Customizations
    If you can’t find templates or connectors in template gallery, in such case we can create our own API and use as custom connector.

  • Integration
    Logic App easily leverages the power of BizTalk, Microsoft integration to enable integration professional to build solution they need.

Demo

Now, we are going to understand and implement step by step details to create logic apps and implement a simple demo which sends mail using Gmail account on tweets of particular # hash trends to desire users after specific time interval trigger.

  • To create logic app you have Azure subscription first, if you don’t you can get free Azure trial subscription from here.
  • On Azure portal, we have to create logic app first, just type logic app in search text box, logic app pane will appear.

    Azure

  • Click on logic app new logic app pane will be appears in next, click ‘Create’ button at bottom.

    Azure

  • By clicking Create, it opens new pane in which we need to add name for our new logic app Name, select subscription, create or select resource group and region for logic app and click Create.

    Azure

  • It will create a logic app with mentioned configurations, now we see our logic app under our resouces. By clicking on it we can edit it in visual designer.

    Azure

  • Click Logic app designer, a new pane will open next to it.  We can select templates as per requirement, we can select addition template from selected category as well.

    Azure

  • Select template, for examle Twitter -when new tweet is posted. In the next step we need to add search text only. For first time it will ask for twitter login.

    Azure

  • By clicking edit, we can edit time interval to trigger the tweeter trigger. we can set time interval from seconds to days.

    Azure

  • After this we have decide which action we need to set against #Azure tweets, whether we need store or sent mail or want to custom actions. we can add next step by clicking next step button at bottom. Here we will take simple send mail with new tweet text and sender name to our mail id.

    Azure

    Azure

  • Click on “Add Action”, it will ask to select Action from ready templates we can select or we can have various templates like outlook, Gmail, Send Grid, Salesforce. we can type and search template as well.

    Azure

  • Here we are using Gmail template to send mail on new tweet posted.

    Azure

  • Select Send mail from options, it will ask for Gmail account credentials just put your login credentials and proceed, after this step we need fill all the details for mail which we are sending.

    Azure

  • In TO you can put another mail id, in subject add relevant text. For email body we have to select parameters from pop-up pane like ‘Description, ‘location’, ‘tweeted’,etc.

    Azure

  • Attachment name, content,content type also we can send mail to BCC and CC using advance options.

    Azure

  • In the last steps, after adding all details we need to save workflow in the designer by clicking save button at the top right corner.

    Azure

  • To run logic app, click Run from top menu.

    Azure

  • Now, logic app has started. You can get email.

    Azure

After a successful run, you get mails on your mail id which we added in the To section.

Azure

On the portal, we can see the details for each instance.

Azure