Skip to content

Azure Module

Overview

The Azure module provides integration with Microsoft Azure cloud services for the BidScript backend. It handles document storage, AI services, document parsing, and database connections.

Module Structure

azure/
├── azure.module.ts            # Module definition and configuration
├── azure.service.ts           # Core Azure services integration
├── blob.service.ts            # Azure Blob Storage management
├── document-parse.service.ts  # Document parsing and analysis
├── document-parse.controller.ts # API endpoints for document parsing
└── azure-sql.service.ts       # Azure SQL database integration

Key Components

AzureModule

The root module that configures Azure services and provides them to the application.

  • Imports: ConfigModule, LangchainModule, RagModule, VectorstoreModule
  • Providers: AzureService, AzureSqlService, BlobService, DocumentParseService
  • Controllers: DocumentParseController
  • Exports: AzureService, AzureSqlService, BlobService, DocumentParseService

AzureService

Handles Azure OpenAI integration and document processing logic: - Theme management for document processing - Document summary generation and parsing - Question generation and processing - Integration with RAG and Vectorstore services

BlobService

Manages Azure Blob Storage operations: - Document upload and download - Container management - File processing

DocumentParseService

Handles document parsing and text extraction: - Processes document contents - Extracts text and metadata - Integrates with other services for document processing

DocumentParseController

Provides API endpoints for document parsing operations.

AzureSqlService

Provides integration with Azure SQL Database for data storage and retrieval.

Configuration

The Azure module is configured through environment variables:

# Azure Storage
AZURE_STORAGE_CONNECTION_STRING

# Azure OpenAI
AZURE_OPENAI_API_KEY
AZURE_OPENAI_ENDPOINT
AZURE_OPENAI_DEPLOYMENT_NAME

# Azure SQL
AZURE_SQL_SERVER
AZURE_SQL_DATABASE
AZURE_SQL_USERNAME
AZURE_SQL_PASSWORD