Straight to the point: is there a way to handle EventGrid events in WebJobs?
What I've got so far is:
var builder = new HostBuilder()
.UseEnvironment(Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"))
.ConfigureWebJobs(config =>
{
config.AddEventGrid();
config.AddAzureStorageCoreServices();
// config.AddTimers();
})
Which registers the EventGrid extension, I also have a handler (class with a method using EventGridTrigger
attribute).
When I run it I can see in logs that the extension is initialised:
And the host seems to be aware of the function as well:
This is my function / handler so far (not very helpful presumably):
public class EventGridHandler
{
public Task Run([EventGridTrigger] CloudEvent ev)
{
return Task.CompletedTask;
}
}
Few questions that are rather obvious:
Short answer: It's not possible
Longer answer: In order to expose EventGrid
extension one needs an implementation for IWebhookProvider
and the only implementation I could find lives in Azure Functions Host