January 16, 2025

Intelligent Document Management with Azure

Project Overview

At Sangam Supermarket and Wholesale, I created a set of Python scripts to run locally on an on-premise server to automatically organize invoices and bills in their Google Drive. Recently, I converted this solution into a serverless function in Azure to explore the platform further. The new solution leverages Azure Functions, Blob Storage, and App Insights to automate the organization of invoices.

Problem Statement

The manual process of organizing invoices and bills was time-consuming and prone to errors. Staff had to manually sort and rename files, which was inefficient and led to difficulties in finding specific documents.

Solution Approach

To address this, I developed a serverless function in Azure that automates the organization of invoices. The function uses the Google Drive API to retrieve files from a specific folder and leverages OpenAI's GPT-4o-mini to read the invoices and determine the vendor and date. The function then renames the files, creates necessary folders, and updates a vendor list stored in Azure Blob Storage as a JSON file.

Technical Implementation

Architecture

The solution consists of Azure Functions for processing, Blob Storage for storing organized files and vendor lists, and App Insights for monitoring and logging. The function is triggered by new files in the Google Drive folder, processes the files using Python and OpenAI's API, and updates the Blob Storage accordingly.

Key Features

  • Automated file retrieval and processing using Google Drive API
  • Intelligent document classification with OpenAI's GPT-4o-mini
  • Dynamic file renaming and folder creation
  • Real-time updates to vendor list in Azure Blob Storage
  • Comprehensive monitoring and logging with App Insights

Results & Impact

  • Time Efficiency: The solution dramatically reduced the time required to organize invoices, allowing staff to focus on more strategic tasks.
  • Improved Accuracy: Automated processing reduced errors and ensured consistent organization of documents.
  • Enhanced Workflow: Staff can now simply scan or drop an invoice into Google Drive, and the system automatically organizes it in the correct location.
  • Scalability: The serverless architecture allows for easy scaling as the volume of invoices increases.

Key Learnings

  • The Importance of Automation: Automating repetitive tasks can significantly improve efficiency and accuracy.
  • User-Centered Design: Tailoring solutions to the user's needs ensures better adoption and satisfaction.
  • Cloud Platforms: Exploring Azure's serverless capabilities provided valuable insights into cloud-based automation and scalability.