Create your First Azure Logic App and perform Automated OCR

Ritul
5 min readNov 1, 2019

--

Introduction

The aim of this article is to make you familiar with azure logic apps. Azure Logic Apps is a cloud service that helps you schedule, automate, and orchestrate tasks, business processes, and workflows when you need to integrate apps, data, systems, and services across enterprises or organizations. You can read more about it here.

Let’s begin

In this article we will create a logic app that checks whenever an image is uploaded to dropbox, the logic app performs OCR and saves the content of the image to a .txt file in dropbox automatically. For this, we will use the Computer Vision API. When we will be done, It will look like this workflow at a higher level.

Logic App for performing OCR on the image uploaded to dropbox

Sign in to the Azure portal

Sign in to the Azure portal with your Azure account credentials.

Create your logic app

  1. Go to the Azure home page, find and select the Logic App.

2. Select Add on Logic Apps page.

3. Under Create logic app, provide details about your logic app as shown here. After you’re done, select Create.

4. After Azure deploys your app, select Notifications > Go to resource for your deployed logic app.

5. The Logic Apps Designer opens and shows a page with an introduction video and commonly used triggers. Under Templates, select the Blank Logic App.

Get file from Dropbox

6. In Logic App Designer, under the search box, select All.

Enter Dropbox in the search box and select trigger when the file is created

7. It will ask you to Sign in. Click on that, enter your details and sign in with your dropbox account. After that select the folder and fill the remaining information as shown here.

8. Next click on the New step. Under All tab choose Dropbox and search for action Get file content and fill as shown here.

Save the file in AzureBlob Storage

9. Click on New step. Search for Blob storage in the search box and select action Create blob.

10. For creating a blob you must be having a storage account. Follow this to create one. After that fill in any name for your connection, select your storage account and click Create.

11. After creating blob, Fill in the folder path, blob name, and blob content.

12. Click on New step. Search for Azure blob storage again and select action Get blob content. Fill in as shown here.

OCR using Azure’s Computer vision API

Now our image, initially uploaded to dropbox is saved in Azure’s Blob storage. We will use Azure’s Computer vision API to perform Optical Text Recognition on the saved image and then will save that Text again in Dropbox as a .txt file

13. Click on the Next step. Search for Computer Vision under All tab and select OCR to Text.

14. Search computer vision resource in the search box on the Azure home page and create one by filling the details. From Notification go to the newly created resource and copy site URL and access key and paste as shown. Click Create.

15. Now select Image Content and File Content as shown. Click Next step.

Save Detected Text to Dropbox

16. Search again for Dropbox and select action Create file. Fill the details as shown( click See more on right to get Detected Text in case if it doesn't appear).

17. Click on the Save and then Run.

Test our Logic App

To test this upload an image to dropbox after clicking Run.

After a few seconds, You will have a .txt file in the same folder containing the detected text.

Conclusion

By following this article, you will have some understanding of how Logic App works. However Azure provides many other services such as Azure Funtion App and Azure Databricks. This is the most basic automation we can do using Logic Apps for fun. Apart from this, there are various complicated workflow automation can be done on a very large scale by integrating Logic apps with Databricks and Azure Functions.

--

--

Ritul

Data Science Enthusiast | Advanced Analytics Intern at EY