pm7y / AzureEventGridSimulator

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.
MIT License
82 stars 39 forks source link

Docker - There are no configured topics. The application will now exit #138

Closed Ryan-RJM closed 1 year ago

Ryan-RJM commented 1 year ago

When running the Azure Event Grid Simulator on docker, with the ConfigFile environment variable defined, it exits with this error: "There are no configured topics. The application will now exit"

docker-compose.yml

version: "3.9"
services:
  eventgrid:
    image: pmcilreavy/azureeventgridsimulator:latest
    restart: unless-stopped
    ports:
      - 60101:60101
    volumes:
      - S:\Development\AzureEventGridSimulator\docker:/aegs:ro
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_Kestrel__Certificates__Default__Path=/aegs/azureEventGridSimulator.pfx
      - ASPNETCORE_Kestrel__Certificates__Default__Password=123456
      - TZ=Europe/London
      - AEGS_Serilog__MinimumLevel__Default=Verbose
      - ConfigFile=/aegs/config.json

config.json

{
  "topics": [
    {
      "name": "MyAwesomeTopic",
      "port": 60101,
      "key": "TheLocal+DevelopmentKey=",
      "subscribers": [
        {
          "name": "LocalAzureFunctionSubscription",
          "endpoint": "http://localhost:7071/runtime/webhooks/EventGrid?functionName=PersistEventToDb",
          "filter": {
            "includedEventTypes": ["my.eventType"]
          }
        }
      ]
    }
  ]
}

Directory Files

image

Error

image

pm7y commented 1 year ago

Hi, Please amend your docker compose file as follows and see if this resolves it...

- AEMS_ConfigFile=/aegs/config.json

pm7y commented 1 year ago

I'll close this for now. Please re-open if you still have an issue.