Usage of Logic Apps in Azure to automate the business needs

Introduction: All my articles are compiled into simple steps with detailed screen shots and elaborative description. By following these steps even, a novice programmer should be able to replicate scenario. Please go through the steps and provide your valuable feedback to make my next articles more clearer and intent.

Note: I took help of various internet sources while researching this item. Credit goes to internet and Microsoft communities.

This is my second article on Azure.

Please click below link to read my other azure articles

Building a web API & web application on Azure platform as a service. – Site Title (wordpress.com)

Follow below mentioned 28 steps to build and deploy a Logic App to automate business needs.

After completing this blog, you will be able to do

  • Create Logic app by using Azure
  • Create API management resource

Step 1: Open Azure portal (https://portal.azure.com)

Step 2: Create a Resource Group as shown below

Step 3: Create an API Management resource as shown below. First Click on Create a Resource link on home page. Search with API Management Link and Click on Create button.

While creating API resource please select consumption plan(which will be scaled based on consumption

What is API Management resource? – Azure API management(APIM) helps organizations to publish there API’s to external, partner and internal developers to unlock the potential of their data and services.(FROM MS)

Step 4: Now we need to create a new logic app. Click on Create a Resource, search for Logic app and click on Create.

Step 5: Now create a storage account as shown below.

Step 6:  Now its time to upload files to storage account we created in previous step. By using storage account, we can store data in the form of blob, files, tables, queues, etc. Please see storage account definition I gave in my other articles.

Step 7: Select the storage account we created in step #5 and click on File Service tab> file shares link.

Step 8: Now click on Add File share link and create a new file share. This file share can be used to upload your files.

Step 9: Select the file share created in previous step and upload files.

Step 10: These sample files I downloaded from github. You can create your own json file. Snap shot of the json file given below.

Step 11: Now its time to work on logic app functionality. Select logic app created in earlier steps and select a Blank Logic App option.

Step 12 : Previous step will produce an interface as shown below.

Step 13: This is an interface to add our work flow logic. It is similar like writing different conditions (like if else in c#), the difference is instead of logic, we will add triggers and actions.

Step 14: Now I need to add a trigger when http request is received. To do that search top text box with “When a HTTP request is received “  and a trigger will be appeared as shown below.

Step 15: Select the Trigger highlighted in previous image to add a new trigger and interface looks like below

Step 16 : Now select the Add new parameter dropdown and select method check box.

Step 17: Now your interface looks below. Select option of get. We added a get method as parameter for this when http request received trigger. What does it mean, when we receive a http request this get method will be executed

Step 18: Now click on next step and add an action to the flow. Search the text box with “List files “  and select Azure file Storage option as shown below. Then click on create.

Step 19 : It will display all the storage accounts available on your server. Select the right storage account and give a connection name

Step 20: Then select the file share folder we created earlier.

Step 21: Till now we configured second step in work flow as an action. This action will retrieve the files we stored in storage account file share based on the trigger we configured earlier. Now add new step, search with Select keyword and select “Select Data Operations” in actions tab.

Step 22:And add the an action as shown below

Step 23: Then search with a response key word and select Response action as shown below. Now we are going to define the response object for this trigger.

Step 24: Define status code and body of the response as shown below.

Step 25: We completed our workflow design as shown above. Now select the API management we created earlier in this article. After selecting API management, go to API tab and create a new logic app.

Step 26: Create a new logic app as shown below.

Step 27: After creating the logic app. Select it and click on the get method we defined and go to test tab.

Step 28: Initiate the get method and observer the json data got received from API. Now you should be able to see the data from the json file we uploaded earlier.

Logic apps will be used in azure in numerous ways. We can use logic apps to automate the work flows and events. Will publish more articles on Logic apps in near future.

Happy Coding.