Open Goldstorm opened 4 weeks ago
Thanks for reporting this one @Goldstorm. Looking at error it appears to be breaking at network interaction, I have few questions on setup:
Can you provide above details on your topology?
Absolutely.
Basically, everything is running locally. I am trying to emulate everything without utilizing azure cloud at the moment.
Hi @Goldstorm did you figure out what was the issue even I have same issue
Hi @Goldstorm / @phs18 ,
I spent some time repro'ing the issue and realized that it was caused due to older Event Hub extension package bundled with above mentioned extension bundle.
To communicate with emulator, we must use latest extension package. Could you please manually add the below package to solution and retry?
ExtensionPackage="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="6.3.0"
where do we need to add this @Saglodha
To communicate with emulator, we must use latest extension package. Could you please manually add the below package to solution and retry?
ExtensionPackage="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="6.3.0"
I am unsure if this is possible within python. This appears to be a nuget package. The latest version for Azure Eventhubs is here in PyPi. However, when loading up the Azure Function, I do see that we are using the Azure 5.5 extension bundle
[2024-06-21T15:00:30.900Z] Loading startup extension 'EventHubs' [2024-06-21T15:00:30.903Z] Loaded extension 'EventHubs' (5.5.0.0)
Where / which file should this be put in if utilizing Python? I am using this guide for the bindings: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-hubs?tabs=isolated-process%2Cextensionv5&pivots=programming-language-python
@Goldstorm / @phs18 ,
According to Azure functions documentation. using extension bundles in non .NET language is indeed the recommended approach. Since we recently announced emulator interaction, the underlying extension package isn't updated to reflect latest one in extension bundle.
To get unblocked you can manually add extension package using func extension install command via function core tools. Ensure to remove the extension bundle from host.json before manually installing this package. Below documentation has detailed information to follow:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-register#explicitly-install-extensions https://learn.microsoft.com/en-us/azure/azure-functions/functions-core-tools-reference?tabs=v2#func-extensions-install
Command to run:
func extensions install --package Microsoft.Azure.WebJobs.Extensions.EventHubs --version 6.3.0
We realize this isn’t a permanent resolution, but it should help you move forward. We’ll also collaborate internally with functions team to update the extension bundle.
Command to run:
func extensions install --package Microsoft.Azure.WebJobs.Extensions.EventHubs --version 6.3.0
Does not work, unfortunately. I think it can't find it in the particular extension bundle?
I did use 6.3.0, and 6.3.3 fyi
Command to run: func extensions install --package Microsoft.Azure.WebJobs.Extensions.EventHubs --version 6.3.0
Does not work, unfortunately. I think it can't find it in the particular extension bundle?
I did use 6.3.0, and 6.3.3 fyi
First remove extensinoBundle from host.json
Then you'll be able to add the package, & it will create an extensions.csproj
file like in my PR #20
@ranma2913 DID THIS SETTING WORK FOR YOU IT THRE THIS ERRRO [2024-06-21T16:52:55.875Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
@phs18, I followed this example: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-hubs-trigger?tabs=python-v2%2Cisolated-process%2Cnodejs-v4%2Cfunctionsv2%2Cextensionv5&pivots=programming-language-javascript#example they don't mention anything about binder/registration.
Do you have any example code I could look at that might be more verbose or complete than the Azure Docs?
@ranma2913
VERBOSE.txt
host.json
local.settings.json
requirements.txt
FUNCTION_APP.PY
import logging import azure.functions as func
app = func.FunctionApp()
@app.function_name(name="EventHubTrigger1") @app.event_hub_message_trigger(arg_name="myhub", event_hub_name="eh1", connection="connection") def test_function(myhub: func.EventHubEvent): logging.info('Python EventHub trigger processed an event: %s', myhub.get_body().decode('utf-8'))
Command to run: func extensions install --package Microsoft.Azure.WebJobs.Extensions.EventHubs --version 6.3.0
Does not work, unfortunately. I think it can't find it in the particular extension bundle?
I did use 6.3.0, and 6.3.3 fyi
First remove extensinoBundle from host.json
Then you'll be able to add the package, & it will create an
extensions.csproj
file like in my PR #20
This was it! So the solution to this is as follows
Ill be sure to put up a python code snippet when I get time this weekend.
@Goldstorm can you please share your settings and code for it. i am having similar issue
Describe the bug When setting up an in bound or outbound eventhub trigger utilizing the azurefunction library, the function trigger fails to start with this error:
To Reproduce
local.settings.json
with the following config:function_app.py
to reflect this:app = func.FunctionApp()
@app.event_hub_message_trigger(arg_name="azeventhub", event_hub_name="eh-local-topic", connection="connection") def inbound_eh(azeventhub: func.EventHubEvent): logging.info('Python EventHub trigger processed an event: %s', azeventhub.get_body().decode('utf-8'))