page_type | languages | products | urlFragment | |||||
---|---|---|---|---|---|---|---|---|
sample |
|
|
extension-eventhub-samples |
These are code samples that show common scenario operations with the Azure Functions Extension EventHub library.
These samples relate to the Azure EventHub library being used as part of a Python Function App. For examples on how to use the Azure EventHub library, please see Azure EventHub samples.
- eventhub_samples_eventdata - Examples for using the EventData type:
- From EventHubTrigger
- Python 3.9 or later is required to use this package. For more details, please read our page on Python Functions version support policy.
- You must have an Azure subscription and an Azure storage account to use this package.
- Install Core Tools
- Install the Azure Functions Extension EventHub library for Python with pip:
pip install azurefunctions-extensions-bindings-eventhub
- Clone or download this sample repository
- Open the sample folder in Visual Studio Code or your IDE of choice.
- Open a terminal window and
cd
to the directory that the sample you wish to run is saved in. - Set the environment variables specified in the sample file you wish to run.
- Install the required dependencies
pip install -r requirements.txt
- Start the Functions runtime
func start
- Execute the function by uploading an event to the EventHub that is being targeted.
Visit the SDK-type bindings in Python reference documentation to learn more about how to use SDK-type bindings in a Python Function App and the API reference documentation to learn more about what you can do with the Azure EventHub library.