A .NET Aspire-based form submission and notification system powered by Azure Functions, Cosmos DB, and Service Bus.
Mercury is a serverless application built with .NET Aspire that handles form submissions and notifications. It consists of two Azure Functions that work together to process and notify about form submissions.
┌─────────────────┐ ┌──────────────────┐
│ Submission │ │ Notification │
│ Function │◄──────►│ Function │
│ (HTTP Trigger) │ │ (Queue Trigger) │
└────────┬────────┘ └────────┬─────────┘
│ │
▼ ▼
┌─────────────────────────────────────┐
│ Cosmos DB (Serverless) │
│ forms-db │
└─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Service Bus (Standard) │
│ submissions queue │
└─────────────────────────────────────┘
- Form Submission Processing: HTTP-triggered function to handle form submissions
- Notification System: Queue-triggered function for processing notifications
- Serverless Database: Cosmos DB with serverless billing
- Message Queue: Azure Service Bus for reliable message processing
- Monitoring: Application Insights for telemetry and logging
- Secure: Managed Identity for all Azure service authentication
- .NET 10.0: Latest .NET runtime
- Azure Functions V4: Isolated worker model
- Azure Cosmos DB: NoSQL serverless database
- Azure Service Bus: Message queue
- Application Insights: Monitoring and telemetry
- .NET Aspire: Cloud-native orchestration
- .NET 10.0 SDK or later
- Azure CLI
- Azure subscription
- Docker Desktop (for local development)
-
Clone the repository
git clone https://github.com/Nodsoft/Mercury.git cd Mercury -
Restore dependencies
dotnet restore
-
Run with Aspire
dotnet run --project Nodsoft.Mercury.AppHost
-
Access the Aspire Dashboard
- Open browser to
http://localhost:15888 - View running services, logs, and traces
- Open browser to
See DEPLOYMENT.md for comprehensive deployment guide.
Using GitHub Actions:
- Configure GitHub secrets (see DEPLOYMENT.md)
- Push to
mainbranch or trigger workflow manually
Using Scripts:
# Bash (Linux/macOS/WSL)
./scripts/deploy-azure.sh
# PowerShell (Windows)
.\scripts\deploy-azure.ps1Mercury/
├── .github/
│ └── workflows/ # CI/CD workflows
├── infra/ # Infrastructure as Code (Bicep)
├── scripts/ # Deployment and utility scripts
├── Nodsoft.Mercury.AppHost/ # Aspire orchestration
├── Nodsoft.Mercury.Functions.Submission/
│ └── Functions/ # HTTP-triggered functions
├── Nodsoft.Mercury.Functions.Notification/
│ └── NotificationFunctions.cs # Queue-triggered functions
├── Nodsoft.Mercury.Data/ # Data access layer
├── Nodsoft.Mercury.Models/ # Shared models
└── Nodsoft.Mercury.ServiceDefaults/ # Aspire service defaults
The AppHost configures all services with emulators:
- Cosmos DB emulator
- Service Bus emulator
- Azure Storage emulator
Environment variables are configured automatically during deployment:
ConnectionStrings__forms-db: Cosmos DB endpointConnectionStrings__submissions-queue: Service Bus namespaceConnectionStrings__notifications-mq: Service Bus namespace
All connections use Managed Identity (no connection strings with keys).
Monitor your application in Azure Portal:
- Navigate to Application Insights resource:
mercury-ai-live - View:
- Live Metrics
- Failures and exceptions
- Performance metrics
- Custom logs
# View live logs
az functionapp log tail \
--resource-group mercury-live \
--name <function-name>dotnet builddotnet testInfrastructure validation:
bicep build infra/main.bicepShell script linting:
shellcheck scripts/*.sh- deploy-azure.yml: Main deployment pipeline
- validate-infra.yml: Infrastructure validation
- deploy-aspire.yml: Aspire-based deployment (future)
- Code pushed to
main - Infrastructure deployed via Bicep
- Functions built and packaged
- Functions deployed to Azure
- Configuration applied
Remove all Azure resources:
# Bash
./scripts/cleanup-azure.sh
# PowerShell
.\scripts\cleanup-azure.ps1
# Azure CLI
az group delete --name mercury-live --yes- DEPLOYMENT.md: Complete deployment guide
- infra/README.md: Infrastructure documentation
- .github/DEPLOYMENT_SUMMARY.md: Quick reference
Build Errors: Ensure .NET 10.0 SDK is installed
dotnet --list-sdksDeployment Failures: Check GitHub Actions logs and Azure Portal
Function Issues: Review Application Insights for errors
See DEPLOYMENT.md for detailed troubleshooting.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
[Add your license here]
- GitHub Issues: Report bugs and feature requests
- Documentation: See DEPLOYMENT.md
- Azure Support: Azure Support Portal
Built with: