Why Azure function failing to start when bound with EventGrid attribute bound with IAsyncCollector
Muhammad Usman Khalil
1
Reputation point
Hello,
I am facing strange initialization issue regarding Azure Function.
Following is the code for HttpTriggered Azure Function.
public static async Task<IActionResult> OnboardOrganization(
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "onboarding/organization/")]
HttpRequest httpRequest,
[EventGrid(TopicEndpointUri = "MyEventGridTopicUriSetting", TopicKeySetting = "MyEventGridTopicKeySetting")]
IAsyncCollector<EventGridEvent> outputEvents, ILogger log)
{
var credentialSpecifier = CredentialSpecifier.NewBuilder()
.AllowRole(Role.Admin).AllowRole(Role.OrgAdmin).Build();
var requestBody = RequestProcessor.GetRequestBodyAsString(httpRequest);
......................................................................
}
But If I remove reference of 'Microsoft.Azure.WebJobs.Extensions.EventGrid', error goes away.
Error at console :
Can any body let me know how to getrid of this? Thanks