Cloud Configuration Guide

Multi-cloud support via Environment Variables

Environment-Based Configuration

Configure your cloud provider via environment variables for maximum security and simplicity:

🌍 Environment Variables

All configuration via environment variables and Azure Key Vault. Set in Azure App Service, AWS ECS, GCP Cloud Run, or Docker.

  • ✅ Deployment-time configuration
  • ✅ Secrets in Key Vault (never in code)
  • ✅ Infrastructure as Code compatible
  • ✅ No database-stored credentials
🔍 System Validation

Verify your configuration at runtime via admin endpoints:

  • POST /api/admin/system/validate-config
  • GET /api/admin/system/backup-status
  • Tests live connections to storage, secrets, backup
🎨 Branding & White-Label

Customize the service appearance for your organization:

  • Redirect landing page to your portal
  • Custom error pages for failed downloads
  • Show or hide API documentation

🎨 Branding & White-Label Configuration

Customize the service for your organization. These settings are cloud-agnostic and apply to all providers.

# Landing Page Redirect
# Redirect the root URL ("/") to your own portal instead of the AIVINOVA landing page
# Leave empty to show the default landing page
Branding__LandingPageRedirectUrl=https://portal.yourcompany.com

# Download Error Page
# Redirect browser users to your custom error page when a public download link fails
# Query parameters are appended automatically: ?error=LINK_EXPIRED&code=410
# Leave empty to return the default JSON error response
Branding__DownloadErrorPageUrl=https://portal.yourcompany.com/download-error

# API Documentation
# Set to false to hide the Scalar API docs UI and OpenAPI endpoint
# Default: true
Branding__ShowApiDocs=false
💡 Default Behavior

Without any Branding configuration, the service shows the AIVINOVA landing page, returns JSON error responses for failed downloads, and exposes the API documentation at /scalar/v1.

Best Practice: Environment Variables

All configuration is done via environment variables. Set them in your container runtime (Docker -e, Azure App Settings, AWS ECS Task Definition, GCP Cloud Run Variables). Sensitive values should be stored in your cloud provider's secret management service.

Configuration by Cloud Provider

Select your cloud provider to see configuration examples:

Microsoft Azure

Microsoft Azure

Azure Blob Storage • Azure SQL • Azure Key Vault

1. Storage (Azure Blob Storage)
# Recommended: Managed Identity (Production)
BlobStorage__AccountName=aivinovadocs
BlobStorage__ContainerName=documents
BlobStorage__UseAzureAd=true

# Alternative: Connection String (Development)
BlobStorage__UseAzureAd=false
BlobStorage__ConnectionString=DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...
BlobStorage__ContainerName=documents
✅ Recommended: Managed Identity

Use useAzureAd: true with Managed Identity. No storage keys or connection strings needed!

2. Database (Multi-Provider Support)

Azure supports SQL Server, PostgreSQL, and MySQL. PostgreSQL is recommended for multi-cloud deployments.

✅ Recommended: PostgreSQL for Azure Database

PostgreSQL offers excellent performance, JSONB support, and consistency across Azure, AWS, and GCP. Available as Azure Database for PostgreSQL.

# Database Provider (SqlServer, PostgreSQL, MySQL)
Database__Provider=PostgreSQL

# PostgreSQL with Managed Identity (Recommended)
ConnectionStrings__DefaultConnection=Host=myserver.postgres.database.azure.com;Database=documentservice;Username=admin;Password=***;SSL Mode=Require;

# SQL Server with Managed Identity
Database__Provider=SqlServer
ConnectionStrings__DefaultConnection=Server=tcp:myserver.database.windows.net,1433;Database=documentservice;Authentication=Active Directory Default;

# MySQL
Database__Provider=MySQL
ConnectionStrings__DefaultConnection=Server=myserver.mysql.database.azure.com;Database=documentservice;User Id=admin;Password=***;SslMode=Required;

# Disable automatic database migration on startup (default: false)
# Set to true to skip migrations (e.g. when using external migration tooling)
Database__DisableMigration=false
3. Secrets (Azure Key Vault)
KeyVault__Uri=https://aivinova-kv.vault.azure.net/
4. Authentication (Azure Entra ID)
Authentication__Mode=Both
Authentication__AzureAd__Instance=https://login.microsoftonline.com/
Authentication__AzureAd__TenantId=12345678-1234-1234-1234-123456789abc
Authentication__AzureAd__AdminClientId=87654321-4321-4321-4321-987654321def
Authentication__AzureAd__IsEnabled=true
Amazon Web Services

Amazon Web Services

AWS S3 • RDS/Aurora • Secrets Manager • Cognito

1. Storage (AWS S3)
# Option 1: With IAM Role (EC2/ECS/EKS)
Storage__Provider=S3
Storage__BucketName=aivinova-documents
Storage__Region=eu-central-1
Storage__UseIamRole=true

# Option 2: With Access Keys
AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
AWS_DEFAULT_REGION=eu-central-1
Storage__BucketName=aivinova-documents
✅ Recommended: IAM Role

Use Storage__UseIamRole=true for EC2/ECS. No access keys needed when running on AWS infrastructure!

2. Database (Multi-Provider Support)

AWS supports SQL Server (RDS), PostgreSQL (Aurora/RDS), and MySQL (Aurora/RDS). PostgreSQL is recommended.

✅ Recommended: PostgreSQL (Aurora or RDS)

PostgreSQL offers excellent performance and consistency across all clouds. Available as Aurora PostgreSQL (serverless, auto-scaling) or RDS PostgreSQL.

# Database Provider (SqlServer, PostgreSQL, MySQL)
Database__Provider=PostgreSQL

# PostgreSQL on RDS (Recommended)
ConnectionStrings__DefaultConnection=Host=myinstance.c9akciq32.eu-central-1.rds.amazonaws.com;Port=5432;Database=documentservice;Username=postgres;Password=***;SSL Mode=Require;

# SQL Server on RDS
Database__Provider=SqlServer
ConnectionStrings__DefaultConnection=Server=myinstance.c9akciq32.eu-central-1.rds.amazonaws.com,1433;Database=documentservice;User ID=admin;Password=***;Encrypt=True;

# MySQL on RDS or Aurora MySQL
Database__Provider=MySQL
ConnectionStrings__DefaultConnection=Server=myinstance.c9akciq32.eu-central-1.rds.amazonaws.com;Port=3306;Database=documentservice;Uid=admin;Pwd=***;SslMode=Required;

# Disable automatic database migration on startup (default: false)
# Set to true to skip migrations (e.g. when using external migration tooling)
Database__DisableMigration=false
3. Secrets (AWS Secrets Manager)
Secrets__Provider=AwsSecretsManager
Secrets__Region=eu-central-1
Secrets__SecretPrefix=aivinova/documentservice/
4. Authentication (AWS Cognito)
Authentication__Provider=Cognito
Authentication__Cognito__UserPoolId=eu-central-1_AbCdEfGhI
Authentication__Cognito__Region=eu-central-1
Authentication__Cognito__ClientId=1a2b3c4d5e6f7g8h9i0j1k2l3m
💡 Cross-Cloud Authentication

You can use Azure Entra ID for authentication even when infrastructure runs on AWS! Just configure "authProvider": "EntraId" with AWS storage/database.

Google Cloud Platform

Google Cloud Platform

Cloud Storage • Cloud SQL • Secret Manager • Cloud Identity

1. Storage (Google Cloud Storage)
# Option 1: With Workload Identity (GKE)
Storage__Provider=GCS
Storage__BucketName=aivinova-documents
Storage__ProjectId=aivinova-prod-123456
Storage__UseWorkloadIdentity=true

# Option 2: With Service Account Key
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
Storage__BucketName=aivinova-documents
Storage__ProjectId=aivinova-prod-123456
✅ Recommended: Workload Identity

Use Storage__UseWorkloadIdentity=true for GKE. No service account keys needed!

2. Database (Multi-Provider Support)

GCP supports SQL Server, PostgreSQL, and MySQL via Cloud SQL. PostgreSQL is recommended.

✅ Recommended: PostgreSQL on Cloud SQL

PostgreSQL offers excellent performance and consistency across all clouds. Available as Cloud SQL for PostgreSQL with automatic backups and high availability.

# Database Provider (SqlServer, PostgreSQL, MySQL)
Database__Provider=PostgreSQL

# PostgreSQL via Cloud SQL Proxy (Recommended)
ConnectionStrings__DefaultConnection=Host=/cloudsql/project-id:region:instance-name;Database=documentservice;Username=postgres;Password=***;

# PostgreSQL with Public IP
ConnectionStrings__DefaultConnection=Host=35.198.123.45;Port=5432;Database=documentservice;Username=postgres;Password=***;SSL Mode=Require;

# SQL Server on Cloud SQL
Database__Provider=SqlServer
ConnectionStrings__DefaultConnection=Server=35.198.123.45,1433;Database=documentservice;User ID=sqlserver;Password=***;Encrypt=True;

# MySQL on Cloud SQL
Database__Provider=MySQL
ConnectionStrings__DefaultConnection=Server=35.198.123.45;Port=3306;Database=documentservice;Uid=root;Pwd=***;SslMode=Required;

# Disable automatic database migration on startup (default: false)
# Set to true to skip migrations (e.g. when using external migration tooling)
Database__DisableMigration=false
3. Secrets (Google Secret Manager)
Secrets__Provider=GoogleSecretManager
Secrets__ProjectId=aivinova-prod-123456
Secrets__SecretPrefix=aivinova-documentservice-
4. Authentication (Google Cloud Identity)
Authentication__Provider=CloudIdentity
Authentication__CloudIdentity__ProjectId=aivinova-prod-123456
Authentication__CloudIdentity__ClientId=123456789012-abcdefghijklmnop.apps.googleusercontent.com
💡 Cross-Cloud Authentication

You can use Azure Entra ID for authentication even when infrastructure runs on GCP! Just configure "authProvider": "EntraId" with GCP storage/database.

System Validation

Verify your cloud configuration at runtime using Admin API endpoints:

  1. Validate Runtime Configuration

    Test live connections to all configured cloud services:

    POST /api/admin/system/validate-config
    curl -X POST https://your-api.azurewebsites.net/api/admin/system/validate-config \
      -H "Authorization: Bearer YOUR_ADMIN_JWT_TOKEN"
    
    # Response:
    {
      "isValid": true,
      "validatedAt": "2026-02-09T10:30:00Z",
      "storage": {
        "success": true,
        "tested": true,
        "providerName": "Azure",
        "details": { "accountName": "aivinovadocs" }
      },
      "secrets": {
        "success": true,
        "tested": true,
        "providerName": "Azure",
        "details": { "keyVaultUri": "https://kv-prod.vault.azure.net/" }
      },
      "backup": {
        "success": true,
        "tested": true,
        "providerName": "Azure"
      },
      "secretReferences": {
        "allSecretsExist": true,
        "totalReferences": 5,
        "existingSecrets": 5,
        "missingSecrets": 0
      }
    }
    ✅ Live Connection Tests

    This endpoint tests actual connections to your storage, Key Vault, and backup services. Use it during deployment validation or troubleshooting!

  2. Check Backup Status

    Query cloud-native backup configuration status:

    GET /api/admin/system/backup-status
    curl https://your-api.azurewebsites.net/api/admin/system/backup-status \
      -H "Authorization: Bearer YOUR_ADMIN_JWT_TOKEN"
    
    # Response:
    {
      "success": true,
      "overallStatus": "Protected",
      "storage": {
        "pointInTimeRestoreEnabled": true,
        "restoreDays": 7,
        "versioningEnabled": true,
        "softDeleteEnabled": true,
        "softDeleteDays": 7
      },
      "database": {
        "automaticBackupsEnabled": true,
        "shortTermRetentionDays": 7,
        "longTermRetentionEnabled": false,
        "earliestRestorePoint": "2026-02-02T10:30:00Z"
      },
      "secrets": {
        "softDeleteEnabled": true,
        "purgeProtectionEnabled": true,
        "softDeleteRetentionDays": 90
      }
    }
    Compliance & Audit

    Use this endpoint for compliance checks to verify backup protection meets your requirements (GDPR, ISO 27001, etc.).

  3. Health Check

    Comprehensive health check for monitoring dashboards:

    GET /health
    curl https://your-api.azurewebsites.net/health
    
    # Response:
    {
      "status": "healthy",
      "timestamp": "2026-02-09T10:30:00Z",
      "totalResponseTimeMs": 234.5,
      "checks": {
        "database": { "status": "healthy", "responseTimeMs": 123.4 },
        "blobstorage": { "status": "healthy", "responseTimeMs": 89.2 }
      }
    }
Deployment Platforms

Azure App Service: Settings → Configuration → Application Settings
AWS ECS: Task Definition → Environment Variables
GCP Cloud Run: Edit Service → Variables & Secrets
Docker: docker run -e "BlobStorage__AccountName=..." ...

Complete Configuration Examples

Production-ready environment variable examples for each cloud provider:

Production Environment Variables

# === Storage (Azure Blob Storage) ===
BlobStorage__AccountName=aivinovaprod
BlobStorage__ContainerName=documents
BlobStorage__UseAzureAd=true

# === Database (PostgreSQL recommended) ===
Database__Provider=PostgreSQL
ConnectionStrings__DefaultConnection=Host=myserver.postgres.database.azure.com;Database=documentservice;Username=admin;Password=***;SSL Mode=Require;
# Database__DisableMigration=true  # Set to skip auto-migration

# === Secrets (Azure Key Vault) ===
KeyVault__Uri=https://kv-prod.vault.azure.net/

# === Authentication ===
Authentication__Mode=Both
Authentication__AzureAd__TenantId=12345678-1234-1234-1234-123456789abc
Authentication__AzureAd__AdminClientId=87654321-4321-4321-4321-987654321def

# === Branding (Optional) ===
Branding__LandingPageRedirectUrl=https://portal.yourcompany.com
Branding__DownloadErrorPageUrl=https://portal.yourcompany.com/download-error
Branding__ShowApiDocs=false

Production Environment Variables

# === Storage (AWS S3) ===
Storage__Provider=S3
Storage__BucketName=aivinova-documents
Storage__Region=eu-central-1
Storage__UseIamRole=true

# === Database (PostgreSQL recommended) ===
Database__Provider=PostgreSQL
ConnectionStrings__DefaultConnection=Host=myinstance.c9akciq32.eu-central-1.rds.amazonaws.com;Port=5432;Database=documentservice;Username=postgres;Password=***;SSL Mode=Require;
# Database__DisableMigration=true  # Set to skip auto-migration

# === Secrets (AWS Secrets Manager) ===
Secrets__Provider=AwsSecretsManager
Secrets__Region=eu-central-1
Secrets__SecretPrefix=aivinova/documentservice/

# === Authentication ===
Authentication__Mode=Both
Authentication__AzureAd__TenantId=12345678-1234-1234-1234-123456789abc
Authentication__AzureAd__AdminClientId=87654321-4321-4321-4321-987654321def

# === Branding (Optional) ===
Branding__LandingPageRedirectUrl=https://portal.yourcompany.com
Branding__DownloadErrorPageUrl=https://portal.yourcompany.com/download-error
Branding__ShowApiDocs=false

Production Environment Variables

# === Storage (Google Cloud Storage) ===
Storage__Provider=GCS
Storage__BucketName=aivinova-documents
Storage__ProjectId=aivinova-prod-123456
Storage__UseWorkloadIdentity=true

# === Database (PostgreSQL recommended) ===
Database__Provider=PostgreSQL
ConnectionStrings__DefaultConnection=Host=/cloudsql/project-id:region:instance-name;Database=documentservice;Username=postgres;Password=***;
# Database__DisableMigration=true  # Set to skip auto-migration

# === Secrets (Google Secret Manager) ===
Secrets__Provider=GoogleSecretManager
Secrets__ProjectId=aivinova-prod-123456
Secrets__SecretPrefix=aivinova-documentservice-

# === Authentication ===
Authentication__Mode=Both
Authentication__AzureAd__TenantId=12345678-1234-1234-1234-123456789abc
Authentication__AzureAd__AdminClientId=87654321-4321-4321-4321-987654321def

# === Branding (Optional) ===
Branding__LandingPageRedirectUrl=https://portal.yourcompany.com
Branding__DownloadErrorPageUrl=https://portal.yourcompany.com/download-error
Branding__ShowApiDocs=false
Security Best Practices
  • Never store credentials in plain text or commit them to source control
  • Use Azure Key Vault / AWS Secrets Manager / GCP Secret Manager for all secrets
  • Use managed identities (Azure) or IAM roles (AWS/GCP) when possible
  • Enable encryption at rest and in transit for all storage services
  • Rotate credentials regularly and monitor access logs