-
-
Notifications
You must be signed in to change notification settings - Fork 41
Aspire
This guide explains how to use .NET Aspire for local development of AzureEventGridSimulator.
- .NET 10.0 SDK
- Docker Desktop (Windows/macOS) or Docker Engine (Linux)
- Visual Studio 2022 17.14+ or VS Code with C# DevKit
From the repository root:
cd src
dotnet run --project AzureEventGridSimulator.AppHostThis starts:
- Azure Event Grid Simulator
- Azurite (Azure Storage Emulator)
- Azure Service Bus Emulator
- Azure Event Hubs Emulator
- SQL Server (for Service Bus Emulator)
- Aspire Dashboard (for observability)
The dashboard URL will be displayed in the console output (typically https://localhost:17157).
The dashboard provides:
- Resources: View status of all running services
- Console Logs: Real-time logs from all services
- Structured Logs: Searchable structured log entries
- Traces: Distributed traces showing request flows
- Metrics: Performance metrics
The Event Grid Simulator will be available at the configured topic ports (e.g., https://localhost:60101).
Use the existing Postman collection or curl:
curl -X POST https://localhost:60101/api/events \
-H "Content-Type: application/json" \
-H "aeg-sas-key: YourKey=" \
-d '[{"id":"1","eventType":"test","subject":"test","eventTime":"2025-01-01T00:00:00Z","data":{},"dataVersion":"1.0"}]'After publishing events, open the Traces tab in the Aspire dashboard to see:
- Incoming HTTP request
- Event parsing and validation
- Subscriber delivery attempts
- Retry operations (if any)
If you prefer Docker Compose over Aspire, the existing setup still works:
cd docker
docker-compose up --buildBoth methods provide the same Azure emulator services. The difference is:
- Aspire: Integrated dashboard, automatic service discovery, OpenTelemetry traces
- Docker Compose: Traditional approach, requires manual Seq setup for logging
Topics are configured the same way as before (appsettings.json or environment variables). The Aspire AppHost automatically passes configuration to the simulator.
When running under Aspire, the simulator's ports are managed by the AppHost. To customize:
// In AppHost Program.cs
builder.AddProject<Projects.AzureEventGridSimulator>("eventgridsimulator")
.WithHttpsEndpoint(name: "topic1", port: 60101, isProxied: false)
.WithHttpsEndpoint(name: "topic2", port: 60102, isProxied: false);If using Docker 4.33.0+ on ARM macOS, the Service Bus Emulator may crash due to azure-sql-edge compatibility. Workaround:
- Use an earlier Docker version, or
- Run on x64 architecture
If only one topic port works, ensure isProxied: false is set for all endpoints, or configure ports via Kestrel in appsettings.json.
Check that the dashboard port (17157 by default) is not in use by another application.
Aspire is only for local development. Production deployments continue using:
- Docker image:
pmcilreavy/azureeventgridsimulator:latest - .NET Tool:
dotnet tool install -g AzureEventGridSimulator
Aspire components (AppHost, ServiceDefaults) are not included in production deployments.
Getting Started
Subscribers
Features
Deployment
Reference