Skip to content

Event Grid output binding does not work on Python #638

@johndowns

Description

@johndowns

In the process of updating the documentation for the Event Grid output binding (see this PR), I discovered that the output binding does not work correctly with Python functions. It does work correctly for .NET and Node.js. (Note I have opened a separate issue to log that this doesn't work for Java either.)

Result: Failure
Exception: FunctionLoadError: cannot load the MyFunction function: Python return annotation "EventGridEvent" does not match binding type "eventGrid"
Stack:   File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/dispatcher.py", line 245, in _handle__function_load_request
    function_id, func, func_request.metadata)
  File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/functions.py", line 241, in add_function
    f'Python return annotation "{return_pytype.__name__}" '
  • I wonder if the issue is that the binding extension bundle does not include a reference to the eventGrid output binding (only to eventGridTrigger) - I have no idea how this works though, and if it's sufficient to simply put a PR adding that one line to the extensions.json or if something more needs to be done to wire it up.

Metadata

Metadata

Assignees

Labels

engineeringEngineering improvement. Has no user impact.event-grid

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions