{"id":17114490,"url":"https://github.com/anthonychu/event-grid-local","last_synced_at":"2025-03-23T23:31:15.970Z","repository":{"id":57097937,"uuid":"325143453","full_name":"anthonychu/event-grid-local","owner":"anthonychu","description":"Utlity for relaying Azure Event Grid events to local webhooks via Azure Storage queues.","archived":false,"fork":false,"pushed_at":"2020-12-29T23:11:26.000Z","size":642,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-24T15:23:49.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anthonychu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-29T00:01:58.000Z","updated_at":"2023-04-08T15:19:30.000Z","dependencies_parsed_at":"2022-08-20T18:10:29.032Z","dependency_job_id":null,"html_url":"https://github.com/anthonychu/event-grid-local","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonychu%2Fevent-grid-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonychu%2Fevent-grid-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonychu%2Fevent-grid-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonychu%2Fevent-grid-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthonychu","download_url":"https://codeload.github.com/anthonychu/event-grid-local/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186385,"owners_count":20574550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T17:17:19.768Z","updated_at":"2025-03-23T23:31:15.941Z","avatar_url":"https://github.com/anthonychu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Event Grid Local Debugger\n\nUtlity for relaying Azure Event Grid events to local webhooks via Azure Storage queues. This is an alternative to using an ngrok proxy to test local Event Grid webhooks.\n\n- Automatically manages Storage queues and Event Grid subscriptions\n- Relays Event Grid events via queues and invokes local webhooks\n- Event replays - re-send any event to local webhook\n- Generate cURL command for any received event for running on command line or in Postman\n\n![Screenshot1](media/screenshot1.png)\n\n![Screenshot2](media/screenshot2.png)\n\n## Quickstart\n\n1. Install the package globally.\n\n    ```bash\n    npm install -g @anthonychu/event-grid-local\n    ```\n\n1. Create a config file named `event-grid-local.yml`:\n\n    ```yaml\n    eventSubscriptions:\n      images_blob_created:\n        topic: /subscriptions/\u003csubscription_id\u003e/resourceGroups/\u003cgroup\u003e/providers/microsoft.storage/storageaccounts/\u003caccount\u003e # resource id of Event Grid topic to subscribe to\n        functionName: processImages # name of Azure Function to invoke locally when event is received\n        filter:\n          includedEventTypes:\n            - Microsoft.Storage.BlobCreated\n          subjectBeginsWith: /blobServices/default/containers/images/blobs/\n      pdfs_blob_created:\n        topic: /subscriptions/\u003csubscription_id\u003e/resourceGroups/\u003cgroup\u003e/providers/microsoft.storage/storageaccounts/\u003caccount\u003e\n        webhookUrl: http://localhost:8080/mynodeapp/events # can specify a URL instead of a function name\n        filter:\n          includedEventTypes:\n            - Microsoft.Storage.BlobCreated\n          subjectBeginsWith: /blobServices/default/containers/files/blobs/\n    ```\n\n1. Ensure the Azure CLI is installed and you have logged in.\n\n    ```bash\n    az login\n    ```\n\n1. Create a Storage account to use for relaying events from Event Grid in Azure to your local webhook URLs. **This Storage account must be in the same subscription as your Event Grid topics.** You can use the Azure CLI or portal to create the account. You can also use an existing Storage account.\n\n1. Set an environment variable named `EVENT_GRID_STORAGE_CONNECTION` to the Storage account connection string.\n\n    ```bash\n    export EVENT_GRID_STORAGE_CONNECTION=\"DefaultEndpointsProtocol=https;AccountName=\u003caccount_name\u003e;AccountKey=\u003ckey\u003e;EndpointSuffix=core.windows.net\"\n    ```\n\n1. Create Storage queues and Event Grid subscriptions based on configuration in `event-grid-local.yml`:\n\n    ```bash\n    event-grid-local subscribe\n    ```\n\n    You only need to run this command again when you change the configuration.\n\n1. Start listening to Event Grid events:\n\n    ```bash\n    event-grid-local start\n    ```\n\n    The configured webhooks will be invoked whenever events are received from Event Grid via the queues.\n\n1. To monitor incoming events and re-send (replay) commands, open the dashboard in the browser.\n\n    http://localhost:8081/\n\n---\n\nThis community project is not officially supported by Microsoft.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonychu%2Fevent-grid-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonychu%2Fevent-grid-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonychu%2Fevent-grid-local/lists"}