{"id":22511913,"url":"https://github.com/jandev/azurefunctions-eventgrid","last_synced_at":"2025-04-14T11:40:38.517Z","repository":{"id":34434938,"uuid":"178720986","full_name":"Jandev/azurefunctions-eventgrid","owner":"Jandev","description":"A very lightweight project for publishing events to Azure Event Grid using an Azure Functions output binding","archived":false,"fork":false,"pushed_at":"2022-03-29T13:45:36.000Z","size":67,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-28T00:47:17.459Z","etag":null,"topics":["azure","azure-functions","eventgrid"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jandev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-31T17:38:38.000Z","updated_at":"2022-03-29T13:31:30.000Z","dependencies_parsed_at":"2022-08-08T01:00:43.856Z","dependency_job_id":null,"html_url":"https://github.com/Jandev/azurefunctions-eventgrid","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jandev%2Fazurefunctions-eventgrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jandev%2Fazurefunctions-eventgrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jandev%2Fazurefunctions-eventgrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jandev%2Fazurefunctions-eventgrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jandev","download_url":"https://codeload.github.com/Jandev/azurefunctions-eventgrid/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248874212,"owners_count":21175791,"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":["azure","azure-functions","eventgrid"],"created_at":"2024-12-07T02:14:31.548Z","updated_at":"2025-04-14T11:40:38.475Z","avatar_url":"https://github.com/Jandev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Functions Event Grid binding\r\n\r\nAn easy to use Azure Functions output binding for Azure Event Grid.\r\n\r\n## Moving on\r\n\r\nWhen I created this package, there wasn't an Event Grid binding available for Azure Functions. Nowadays, there is one provided to you by the team. I recommend you start using the binding which is supported by the team in favor of this one. [More information can be found in the docs.](https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-grid?tabs=in-process%2Cextensionv3\u0026pivots=programming-language-csharp).\r\n\r\n## Badges\r\n\r\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=azurefunctions-eventgrid\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=azurefunctions-eventgrid)\r\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=azurefunctions-eventgrid\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=azurefunctions-eventgrid)\r\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=azurefunctions-eventgrid\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=azurefunctions-eventgrid)\r\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=azurefunctions-eventgrid\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=azurefunctions-eventgrid)\r\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=azurefunctions-eventgrid\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=azurefunctions-eventgrid)\r\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=azurefunctions-eventgrid\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=azurefunctions-eventgrid)\r\n\r\n## Download\r\n\r\nThe compiled version can be downloaded via NuGet (https://www.nuget.org/packages/AzureFunctions.EventGridBinding/), so you can use it in your project.\r\n\r\n## Usage\r\n\r\nA sample on how you can use the output binding is as follows.\r\n\r\n```csharp\r\n[FunctionName(\"Test\")]\r\npublic static async Task\u003cIActionResult\u003e Run(\r\n\t[HttpTrigger(AuthorizationLevel.Anonymous, \"get\", Route = null)] HttpRequest req,\r\n\t[EventGrid(\r\n\t\t// The endpoint of your Event Grid Topic, this should be specified in your application settings of the Function App\r\n\t\tTopicEndpoint = \"EventGridBindingSampleTopicEndpoint\",\r\n\t\t// This is the secret key to connect to your Event Grid Topic. To be placed in the application settings.\r\n\t\tTopicKey = \"EventGridBindingSampleTopicKey\")]\r\n\tIAsyncCollector\u003cEvent\u003e outputCollector,\r\n\tILogger log)\r\n{\r\n\tlog.LogInformation(\"Executing the Test function\");\r\n\r\n\t// Create the actual `Data` object you want to publish to Event Grid\r\n\tvar customEvent = new MyCustomEvent\r\n\t{\r\n\t\tIdentifier = 1,\r\n\t\tName = \"Jan\",\r\n\t\tProduct = \"Azure Functions\"\r\n\t};\r\n\t// Specify some meta data of the message you want to publish to Event Grid\r\n\tvar myTestEvent = new Event\r\n\t{\r\n\t\tEventType = nameof(MyCustomEvent),\r\n\t\tSubject = \"Jandev/Samples/CustomTestEvent\",\r\n\t\tData = customEvent\r\n\t};\r\n\r\n\t// Add the event to the IAsyncCollector\u003cT\u003e in order to get your event published.\r\n\tawait outputCollector.AddAsync(myTestEvent);\r\n\r\n\tlog.LogInformation(\"Executed the Test function\");\r\n\r\n\treturn new OkObjectResult($\"Sending {customEvent.Identifier}.\");\r\n}\r\n\r\nprivate class MyCustomEvent\r\n{\r\n\tpublic int Identifier { get; set; }\r\n\tpublic string Name { get; set; }\r\n\tpublic string Product { get; set; }\r\n}\r\n```\r\n\r\nThe publishing of the events will be executed after the Azure Function is finished,\r\nin the `FlushAsync` method of the `IAsyncCollector\u003cT\u003e`.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjandev%2Fazurefunctions-eventgrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjandev%2Fazurefunctions-eventgrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjandev%2Fazurefunctions-eventgrid/lists"}