Azure-docs: Event Hub Output Binding Example with func.Out example

Created on 6 Jul 2020  Â·  3Comments  Â·  Source: MicrosoftDocs/azure-docs

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"
}


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 azure-functionsvc cxp product-question triaged

All 3 comments

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DeepPuddles picture DeepPuddles  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

Favna picture Favna  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments