I came across many implementations in python with output bindings for Event Hub using the $return, however I am unable to find an example with the func.Out object.
In my __init__.py i tried :
def main(events: List[func.EventHubEvent], results: func.Out[func.EventHubEvent])
With functions.json
...
{
"type": "eventHub",
"name": "results",
"eventHubName": "event-hub-20-write",
"connection": "receiverConnectionString",
"direction": "out"
}
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@elbaza1 Thank you for your feedback! We will review and update as appropriate.
@elbaza1 You can refer to the Languages support: https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python#outputs
import azure.functions as func
def main(myblob: func.InputStream, results: func.Out[str]):
results.set('your data')
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "samples-workitems/{name}",
"connection": "myfunctionappstoragemak_STORAGE"
},
{
"type": "eventHub",
"direction": "out",
"connection": "AzureEventHubBusConnectionString",
"name": "results",
"eventHubName": "test"
}
]
}
Hope the above helps. Please let me know if you need any assistance.
@elbaza1 Hope the above helps and clears things up. We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.