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: