Create Your First 'No Code' Logic App in Microsoft Azure
Published Apr 10 2019 08:48 AM 1,391 Views
Steel Contributor

First published on MSDN on May 22, 2018
Editor's note: The following post was written by Cloud and Datacenter Management MVP Timothy Warner as part of our Technical Tuesday series. Simon Timms of the MVP Award Blog Technical Committee served as the technical reviewer for this piece.

Have you ever used If This Then That (IFTTT) , or a related service? These services enable non-technical people to create useful business or personal workflows by linking application programming interface (API) connectors for popular software-as-a-service (SaaS) applications.

For example, I have an IFTTT integration that automatically uploads any photos I take on my Apple iPhone to my Microsoft OneDrive account.

Well, we can look at Azure Logic Apps as a cloud-based variant of BizTalk that offers much of the flexibility of a service like IFTTT. In today's lesson we will create a "Hello world" application that sends us an e-mail message every time a particular hashtag appears on our Twitter timeline.

You can complete this example without typing a single line of code. Logic Apps supports more complicated workflows, of course. However, this simple example introduces the tools you need to succeed.
Create or designate an Azure Log Analytics workspace
Before we deploy our first Azure Logic App, we should either create a new Azure Log Analytics workspace, or decide to link our existing workspace to our upcoming Logic App.

Think of a Log Analytics workspace as a data warehouse to which you can point all your Azure resources and run queries to report on that data. As you can see in Figure 1, you can start with the Free usage tier, which limits per-day data ingestion as well as data retention length.

[caption id="attachment_29775" align="alignnone" width="850"] Figure 1. Create an Azure Log Analytics workspace.[/caption]

Note: The OMS in "OMS workspace" refers to Microsoft Operations Management Suite. Microsoft is gradually incorporating OMS services into Azure; eventually you will no longer see the acronym in the Azure portal.
Create a Logic App
Let's get this party started! Browse to the Logic apps blade and click Add to get started. Fill out the Create logic app form (be sure to associate the logic app with the aforementioned Log Analytics workspace), and click create to submit the deployment. Figure 2 lights the way for you.

[caption id="attachment_29785" align="alignnone" width="850"] Figure 2. Create a new Logic App.[/caption]
Define the app logic
Get it? Logic App <==> app logic? Yes, I'm a clever one, you know. Our task now is to select our new Logic App from the Logic apps blade in the Azure portal. This action invokes the Logic Apps Designer , our no-code control surface. You see a number of common trigger actions, as well as a filterable gallery of pre-built Logic App templates. You should also check out the community templates available for fun and for free at GitHub.

For this example, we'll start with the When a new tweet is posted common trigger. Clicking the tile in Azure portal invokes the workflow builder and prompts us to authenticate to Twitter. If this were a business, we would sign in by using our organizational Twitter account.

Look at Figure 3. You'll be required to authorize Logic Apps to access your Twitter timeline (OAuth authorization in action!).

[caption id="attachment_29795" align="alignnone" width="850"] Figure 3. Link Twitter to our workflow.[/caption]

Now click the Twitter trigger and the window drops down and prompts us for search text and how often we want the Logic App to check Twitter for occurrences of our trigger text. For this example, I'm looking for instances of the #mvpaward hashtag. The default check interval is 3 minutes.

[caption id="attachment_29805" align="alignnone" width="635"] Figure 4. Configuring the Twitter connector.[/caption]

Click New step to continue our workflow. We can add either an action or one or more conditions. For example, we could scope the Logic App to trigger only on tweets that mention the #mvpaward hashtag from users whose Twitter accounts are located in Europe and who have at least 500 followers.

For our simple example, however, click Add an action . This action displays all the possible connectors linked to the Azure Logic Apps ecosystem. When you see the variety of actions you can take, you begin to appreciate how much work the Azure development teams save you.

Trust me, you don't want to study different SaaS vendors' APIs and do all the handshaking and orchestration manually. Blech!

For this example, I want the Logic App to send me a customized email message to my Office 365 mailbox. To do this, select the Office 365 Outlook connector, authenticate to Office 365, and then select Office 365 Outlook - Send an email from the Actions list.

Next, click the Subject and Body fields and the Logic App will expand to show you a long list of dynamic content you can access. Remember, all these options are part of the connector's definition, and yes, you can build your own Logic App connectors if you want to. I show you what I came up with for my e-mail message in Figure 5.

[caption id="attachment_29815" align="alignnone" width="850"] Figure 5. Creating a customized email message.[/caption]

Make sure to click Save periodically to preserve your hard work. Oh, one more thing--unsurprisingly, Azure Logic Apps are defined under the hood as JavaScript Object Notation (JSON) documents. Try clicking Peek code from a connector's ellipses flyout menu to take a look for yourself. You can click Code view from the toolbar to seen the entire Logic App's JSON.
Test it out
From the Logic App Designer interface, click Run to start the new app. I ran over to Tweetdeck and posted a new tweet including the target hashtag:

[caption id="attachment_29825" align="alignnone" width="288"] Figure 6. The tweet.[/caption]

I set my Logic App trigger to query Twitter every two minutes. In less time than that, I saw the notification email message in my inbox:

[caption id="attachment_29835" align="alignnone" width="778"] Figure 7. The Logic App response.[/caption]
Next steps
Well, we covered quite a bit of ground today. I hope that I helped to inspire you to dig deeper into Logic Apps. They represent a powerful cloud technology that your non-programmer colleagues can use to make their professional lives easier and to increase your business' productivity.

I'll leave you with some hand-selected resources to help you surpass your learning curve as quickly as possible. Take care and see you next time!





Timothy Warner is a Microsoft Most Valuable Professional (MVP) in Cloud and Datacenter Management who is based in Nashville, TN. His professional specialties include Microsoft Azure, cross-platform PowerShell, and all things Windows Server-related. You can reach Tim via Twitter @TechTrainerTim , LinkedIn or his personal website, .

Version history
Last update:
‎May 03 2019 04:05 PM
Updated by: