Open ajkimberley opened 3 years ago
@ajkimberley - Thanks for brining this to our attention. We will investigate it further and update you shortly.
@ajkimberley That section actually refers to using v3.x of the Event Grid Extension, not the functions runtime. I believe that is where the confusion here is. So, you would need to install the preview nuget of the same to use the new types.
Thanks for bringing this up! Looks like other docs could be confusing as well in this regard. We are assigning this issue to the content author to update the docs accordingly.
In the code sample following the text "The following example shows a Functions 3.x C# function that binds to an EventGridEvent" there is a using statement to "Azure.Messaging.EventGrid;". I believe this is here to allow access to the EventGridEvent class. However, when I attempted to follow this example, I kept getting the following runtime error:
InvalidOperationException: 'Can't convert from type 'Azure.Messaging.EventGrid.EventGridEvent
After playing around a bit, I found that if I removed the reference to "Azure.Messaging.EventGrid" and replaced it with "Microsoft.Azure.EventGrid.Models" the function would run fine.
I'm not sure whether this is an issue with the documentation (i.e., the code sample contains the wrong package reference) or whether it's an issue caused by me making a mistake when trying to follow along. Apologies if it's the latter.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.