Complete Application : OCR Receipts Processing with Azure Document Intelligence, Function App C#.NET

Complete Application : OCR Receipts Processing with Azure Document Intelligence, Function App C#.NET

This solution is a powerful, end-to-end application for automating receipt processing, built on the robust Microsoft ecosystem. It leverages the cutting-edge capabilities of Azure AI Foundry and Power Automate, with a core logic layer developed in C# using Visual Studio.

The workflow is initiated by a user, who submits a receipt. Power Automate acts as the orchestration engine, detecting new receipt files and triggering the automation process. The receipt data is then passed to an Azure Function—a serverless compute service that runs the custom C# code.

This C# application, developed and managed in Visual Studio, is the brain of the operation. It communicates with Azure AI Foundry (which includes the functionality of Azure AI Services). The first critical step is OCR (Optical Character Recognition), where the application uses a pre-trained model within Azure AI Foundry to accurately extract printed and handwritten text from the receipt image. The process goes beyond simple text recognition; it intelligently extracts structured data like the vendor name, date, total amount, and individual line items, even from complex layouts.

For development and testing, Postman is used to interact with the Azure AI Foundry and Azure Function APIs, allowing developers to test the data extraction and API calls in isolation before integrating them into the full workflow.

Once the C# application has processed the receipt and extracted the data, it hands the information back to Power Automate. From there, the flow can continue with a variety of automated actions, such as:

Saving the extracted data to a database or a SharePoint list.

Sending an email notification to a manager for approval.

Generating a report or updating a dashboard.

This integrated approach provides a scalable, accurate, and highly customizable solution for any organization looking to transform its receipt management process from a manual task into a seamless, AI-driven workflow.

00:04 Introduction. Goal is to create a receipts automation system to process various receipt types including clean copies, mobile screenshots, handwritten notes, and non-English receipts.

01:05 Solution Architecture. A receipt uploaded to a SharePoint list triggers a Power Automate workflow. The workflow calls an Azure Function App, which uses Azure AI Document Intelligence to extract data.

03:31 Function App Development. Creates a new HTTP-triggered Azure Function in CSharp.

06:05 Processing Logic. The function is designed to receive a base64 image string of the receipt.

10:30 Azure AI Integration. Code from the Azure AI Document Intelligence service is integrated into the function to analyze the receipt and return structured JSON data.

45:48 Power Automate Workflow. Builds the flow that is triggered by a new SharePoint item. It gets the attachment and sends its content to the deployed Function App.

59:16 AI-Powered Reporting. The raw JSON from the function is sent to a Copilot prompt tool to be transformed into a readable, natural language summary, which is then posted to Microsoft Teams.

01:11:13 Conclusion. The end-to-end process is summarized, demonstrating a fully automated receipt processing system.

Follow on other platforms 🔻
✖️ Twitter/X: https://x.com/code_and_cloud
🟦 Facebook: https://www.facebook.com/people/Code-Cloud/61579800983565/