Skip to content

A simulator that provides endpoints to mimic the functionality of Azure Event Grid topics and subscribers and is compatible with the Azure.Messaging.EventGrid client library.

License

Notifications You must be signed in to change notification settings

pm7y/AzureEventGridSimulator

Azure Event Grid Simulator

GitHub Workflow Status License .NET Platform

NuGet Version NuGet Downloads Docker Pulls Docker Image Size

GitHub Stars GitHub contributors GitHub tag (latest SemVer) GitHub all releases Last Commit

A simulator that provides HTTPS endpoints to mimic Azure Event Grid topics and subscribers. Compatible with the Microsoft.Azure.EventGrid client library and supports both EventGrid and CloudEvents v1.0 schemas.

Note: This simulator is intended for local development and testing only.

Installation

.NET Tool (Recommended)

# Global install
dotnet tool install -g AzureEventGridSimulator
azure-eventgrid-simulator

# Or local install
dotnet new tool-manifest
dotnet tool install AzureEventGridSimulator
dotnet tool run azure-eventgrid-simulator

Docker

docker pull pmcilreavy/azureeventgridsimulator:latest

Binary

Download from GitHub Releases.

Local Development with Aspire

For an improved local development experience with Azure emulators and built-in observability, use .NET Aspire:

cd src
dotnet run --project AzureEventGridSimulator.AppHost

This starts the simulator along with Azure Storage (Azurite), Service Bus, Event Hubs, and SQL Server emulators. The Aspire Dashboard provides distributed traces, logs, and metrics.

See the Aspire wiki page for details.

Quick Start

Create an appsettings.json file:

{
  "topics": [
    {
      "name": "MyTopic",
      "port": 60101,
      "key": "TheLocal+DevelopmentKey=",
      "subscribers": [
        {
          "name": "MySubscriber",
          "endpoint": "http://localhost:7071/api/MyFunction",
          "disableValidation": true
        }
      ]
    }
  ]
}

Run the simulator, then post events:

curl -k -X POST "https://localhost:60101/api/events?api-version=2018-01-01" \
  -H "Content-Type: application/json" \
  -H "aeg-sas-key: TheLocal+DevelopmentKey=" \
  -d '[{"id":"1","subject":"/test","eventType":"Test","eventTime":"2024-01-01T00:00:00Z","data":{"message":"Hello"},"dataVersion":"1"}]'

Dashboard

Access the built-in dashboard at https://localhost:<port>/dashboard to view event history and delivery status.

Documentation

For detailed documentation, see the Wiki:

Contributing

See the Architecture page for system design details and the Wiki for development guidelines.

Star History

This is a small project but has seen steady growth over time. Thank you to everyone who has starred the repository!

Star History Chart

About

A simulator that provides endpoints to mimic the functionality of Azure Event Grid topics and subscribers and is compatible with the Azure.Messaging.EventGrid client library.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Contributors 10