Closed thedassi closed 11 months ago
Thanks for reporting. will check and update.pls share the all steps with req.txt file. pls follow this doc. https://learn.microsoft.com/en-us/azure/event-hubs/ https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=asgi%2Capplication-level&pivots=python-mode-decorators https://learn.microsoft.com/en-us/azure/azure-app-configuration/
I used all those links to get to where i am now, i have attached all my files to this comment requirements.txt function_app.py.txt SolverEventHubFunction.py.txt azureAppConfiguration.py.txt
@gavin-aguiar pls comment and validate.Thanks
Hi @thedassi , thanks for your patience with this.
For getting configuration settings with Azure App Configuration, please refer to this guide: https://learn.microsoft.com/en-us/azure/azure-app-configuration/quickstart-python?tabs=windowscommandprompt
You can get the AzureAppConfigurationClient
using from_connection_string
and use get_configuration_setting
to obtain the EventHub connection string.
When deploying the app, the connection string does need to be set as an app setting.
Please let me know if you have any further issues.
Is your question related to a specific version? If so, please specify:
Azure Function V2 ExtensionBundle 3.*, 4.0.0
What binding does your question apply to, if any? (e.g. Blob Trigger, Event Hub Binding, etc)
Event Hub Message Trigger Event Hub Output
Question
Is there a way to let event hub message trigger read the connection from app config, im running my function locally and want to read the event hub connection from app config instead of local.settings.json and also when i deploy it into production. Currently i have some custom code that uses the AzureAppConfigurationClient to read configuration out of app config and set them to os.environ variables.
Take note that I'm not the best when it comes to python development so i might be missing something simple. But i keep on getting an error when i try and run my function saying:
Microsoft.Azure.WebJobs.Extensions.EventHubs: EventHub account connection string 'EventHub' does not exist.Make sure that it is a defined App Setting.
I have tried to change connection="EventHub" to connection=os.environ["EventHub"] but then it tries and fiends my evnet hub url as an setting name.
Here i have my azureAppConfiguration.py that reads the settings
here is my function_app.py code