-
-
Notifications
You must be signed in to change notification settings - Fork 41
DotNet Tool
Paul Mcilreavy edited this page Dec 23, 2025
·
1 revision
The simulator can be installed and run as a global or local .NET tool.
Install the tool globally to make it available from any directory:
dotnet tool install -g AzureEventGridSimulatorRun it:
azure-eventgrid-simulatorInstall the tool locally within a project:
dotnet new tool-manifest
dotnet tool install AzureEventGridSimulatorRun it:
dotnet tool run azure-eventgrid-simulatordotnet tool update -g AzureEventGridSimulatordotnet tool update AzureEventGridSimulatordotnet tool uninstall -g AzureEventGridSimulatordotnet tool uninstall AzureEventGridSimulatorThe tool reads configuration from several sources (in order of precedence):
- Command-line arguments
- Environment variables (with
AEGS_prefix) -
appsettings.jsonin the current directory - Custom config file specified via
--ConfigFile
Create an appsettings.json file in the directory where you run the tool:
{
"topics": [
{
"name": "MyTopic",
"port": 60101,
"key": "TheLocal+DevelopmentKey=",
"subscribers": [
{
"name": "MySubscriber",
"endpoint": "http://localhost:7071/api/MyFunction",
"disableValidation": true
}
]
}
]
}azure-eventgrid-simulator --ConfigFile=/path/to/my-config.jsonEnvironment variables use the AEGS_ prefix with __ as the hierarchy separator:
export AEGS_topics__0__name=MyTopic
export AEGS_topics__0__port=60101
export AEGS_topics__0__key="TheLocal+DevelopmentKey="
export AEGS_topics__0__subscribers__0__name=MySubscriber
export AEGS_topics__0__subscribers__0__endpoint=http://localhost:7071/api/events
azure-eventgrid-simulatorThe tool supports multiple .NET runtimes:
- .NET 8.0
- .NET 9.0
- .NET 10.0
The tool will use the highest installed runtime by default due to the RollForward policy.
| Feature | .NET Tool | Docker | Aspire |
|---|---|---|---|
| Installation | dotnet tool install |
docker pull |
Clone repo |
| Configuration | appsettings.json | Environment variables | AppHost code |
| Azure Emulators | Manual setup | docker-compose | Automatic |
| Observability | Serilog | Serilog + Seq | Aspire Dashboard |
| Best for | Quick local testing | CI/CD pipelines | Full local dev |
Ensure the .NET tools directory is in your PATH:
- Windows:
%USERPROFILE%\.dotnet\tools - macOS/Linux:
~/.dotnet/tools
- Verify
appsettings.jsonis in the current working directory - Check JSON syntax is valid
- Try using
--ConfigFilewith an absolute path
If you see a port binding error, another process is using the configured port. Either:
- Stop the other process
- Change the topic port in configuration
- Configuration - Full configuration reference
- Docker - Container deployment
- Aspire - Local development with .NET Aspire
Getting Started
Subscribers
Features
Deployment
Reference