Skip to content

Commit 8fbc518

Browse files
committed
EventGridEvent usable in v1
1 parent c97b0cf commit 8fbc518

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

articles/azure-functions/functions-bindings-event-grid.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,7 @@ using Microsoft.Azure.EventGrid.Models;
134134

135135
public static void Run(EventGridEvent eventGridEvent, TraceWriter log)
136136
{
137-
log.Info("C# Event Grid function processed a request.");
138-
log.Info($"Subject: {eventGridEvent.Subject}");
139-
log.Info($"Time: {eventGridEvent.EventTime}");
140-
log.Info($"Data: {eventGridEvent.Data.ToString()}");
137+
log.Info(eventGridEvent.Data.ToString());
141138
}
142139
```
143140

@@ -212,7 +209,7 @@ For C# and F# functions in Azure Functions 2.x, you also have the option to use
212209
* `Microsoft.Azure.EventGrid.Models.EventGridEvent`- Defines properties for the fields common to all event types.
213210

214211
> [!NOTE]
215-
> In Functions v1 if you try to bind to `Microsoft.Azure.WebJobs.Extensions.EventGrid.EventGridEvent`, the compiler will display a "deprecated" message and advise you to use `Microsoft.Azure.EventGrid.Models.EventGridEvent` instead. However, the replacement type only works in Functions 2.x, so it's best to bind to `JObject` or `string` in Functions 1.x.
212+
> In Functions v1 if you try to bind to `Microsoft.Azure.WebJobs.Extensions.EventGrid.EventGridEvent`, the compiler will display a "deprecated" message and advise you to use `Microsoft.Azure.EventGrid.Models.EventGridEvent` instead. To use the newer type, reference the [Microsoft.Azure.EventGrid](https://www.nuget.org/packages/Microsoft.Azure.EventGrid) NuGet package and fully qualify the `EventGridEvent` type name by prefixing it with `Microsoft.Azure.EventGrid.Models`. For information about how to reference NuGet packages in a C# script function, see [Using NuGet packages](functions-reference-csharp.md#using-nuget-packages)
216213
217214
For JavaScript functions, the parameter named by the *function.json* `name` property has a reference to the event object.
218215

0 commit comments

Comments
 (0)