Skip to main content

Alert.CA.ImageAcquisition

A comprehensive camera management and image acquisition platform built on Azure cloud infrastructure, designed for real-time camera operations, image processing, and panoramic image generation.

Architecture Overview​

Tech Stack​

CategoryTechnology
Runtime.NET 10, Azure Functions v4 (Isolated Worker)
OrchestrationDurable Functions with Netherite backend
DatabasesAzure Cosmos DB (NoSQL), Azure SQL Server
StorageAzure Blob Storage (images), Azure Table Storage (metadata)
MessagingAzure Queue Storage
Real-timeSignalR
Image ProcessingEmgu.CV (OpenCV), System.Drawing
Camera ProtocolVAPIX (Axis cameras)
AuthMicrosoft Entra ID (Azure AD), JWT, Microsoft Identity Web
API PatternsCQRS (MediatR), REST (ASP.NET Core)
MonitoringApplication Insights
ConfigAzure App Configuration + Key Vault

Solution Structure​

Applications​

ProjectTypePurpose
Admin APIASP.NET Core 10 Web APIAdministrative interface for managing cameras, users, and orchestrations
Image Acquisition EngineAzure Functions (Durable)Core engine β€” captures images from cameras via continuous orchestration loops
Camera OperationAzure FunctionsCamera health monitoring, config sync, and third-party integrations
Metadata CleanupAzure FunctionsPeriodic purging of expired image metadata
NotificationAzure FunctionsEmail and SMS notification delivery
Mock Camera APIASP.NET Core 10 Web APILocal development substitute for real cameras

Shared Libraries​

ProjectPurpose
VAPIXServiceAxis camera VAPIX protocol client (image capture, PTZ, overlays)
UCSDServiceUCSD Metadata API client (device configs, credentials)
ImageStorageServicePolymorphic image storage, thumbnails, SignalR broadcasting
ModelsShared DTOs and data models across the solution

Test Projects​

ProjectTests For
Alert.CA.ImageAcquisition.TestImage Acquisition Engine
Alert.CA.CameraOperation.TestCamera Operation
Alert.CA.VAPIXService.TestVAPIX Service
Alert.CA.Admin.API.TestAdmin API
Alert.CA.MetadataCleanup.TestMetadata Cleanup

Data Flow​

Recent Platform Updates​

Getting Started​

Prerequisites​

  • .NET 10 SDK
  • Azure Functions Core Tools v4
  • Docker Desktop (for Durable Task Scheduler)
  • Azure subscription with:
    • Cosmos DB account
    • Storage account
    • App Configuration service
    • Key Vault

Local Development Setup​

1. Install Prerequisites​

Install .NET 10 SDK

# Download from https://dotnet.microsoft.com/download/dotnet/10.0

Install Azure Functions Core Tools v4

npm install -g azure-functions-core-tools@4 --unsafe-perm true

Install Docker Desktop

# Download from https://www.docker.com/products/docker-desktop

2. Set Up Durable Task Scheduler (Required for Local Debugging)​

The Azure Functions project uses the Durable Task Scheduler for orchestration state management. To run locally, you need to run the Durable Task Scheduler in Docker.

Pull the Durable Task Scheduler Docker Image

docker pull cgillum/durabletask-emulator:latest

Run the Durable Task Scheduler Container

docker run -d -p 8080:8080 --name durabletask-emulator cgillum/durabletask-emulator:latest

Verify the Container is Running

docker ps

You should see the durabletask-emulator container running on port 8080.

Stop the Container (when finished debugging)

docker stop durabletask-emulator
docker rm durabletask-emulator

3. Configure Local Settings​

Alert.CA.ImageAcquisition - local.settings.json

{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"ConnectionStrings:AppConfig": "https://{DEV APPCONFIG URL}.azconfig.io",
"CosmosDbOptions:CosmosDbUrl": "AccountEndpoint={DEV COSMOSDB URL};AccountKey={DEV ACCOUNT KEY};",
"StorageOptions:QueueUrl": "DefaultEndpointsProtocol=https;AccountName={DEV STORAGE ACCOUNT NAME};AccountKey={DEV ACCOUNT KEY};EndpointSuffix=core.windows.net",
"DTS_TASK_HUB": "debug",
"DTS_ENDPOINT": "Endpoint=http://localhost:8080;Authentication=None",
"AzureWebJobsSecretStorageType": "files"
}
}

Key Configuration Notes:

  • DURABLETASK_SCHEDULER_CONNECTION: Points to local Docker container (localhost:8080)
  • TASKHUB_NAME: Local task hub name for development
  • Update connection strings to point to your development Azure resources

Alert.CA.Admin.API - appsettings.Development.json

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"AppConfig": "https://{DEV APPCONFIG URL}.azconfig.io"
}
}

4. Run the Applications​

Start the Durable Task Scheduler (if not already running)

docker start durabletask-emulator

Run the Azure Functions Project

cd Alert.CA.ImageAcquisition
func start

Run the Admin API

cd Alert.CA.Admin.API
dotnet run

The Admin API will be available at https://localhost:7xxx (check console output for exact port). The Functions app will be available at http://localhost:7071.

5. Development Workflow​

Image Storage: Images are stored in Azure Blob Storage (development account) Queue Processing: Message queues use Azure Queue Storage (development account) Metadata: Table storage operations use Azure Table Storage (development account) Durable Functions: State management uses Durable Task Scheduler (local Docker container) API Testing: Use Swagger UI at https://localhost:7xxx/swagger for Admin API testing

6. Troubleshooting​

Functions Not Starting

  • Ensure Docker container is running: docker ps
  • Check container logs: docker logs durabletask-emulator
  • Verify port 8080 is not in use by another application

Authentication Issues

  • Ensure you're logged into Azure CLI: az login
  • Verify Managed Identity has access to App Configuration and Key Vault
  • For local development, use DefaultAzureCredential which chains Visual Studio, CLI, and other credential types

Orchestration State Issues

  • Restart the Durable Task Scheduler container to clear state:
    docker restart durabletask-emulator

Deployment​

The application is designed for Azure deployment with:

  • Azure Functions consumption or premium plans
  • Azure Durable Task Scheduler for production orchestration
  • Application Insights for monitoring
  • Managed Identity for secure Azure service access
  • Azure App Configuration for centralized configuration
  • Azure Key Vault for secrets management

This architecture enables reliable, scalable image acquisition from hundreds of cameras while providing real-time processing, storage, and distribution capabilities. The Admin API provides comprehensive management capabilities following modern architectural patterns (CQRS, MediatR, clean architecture) for maintainability and testability.