-
Notifications
You must be signed in to change notification settings - Fork 65
Description
🐛 Describe the bug
After updating to Python 3.14 the function app was not able to start again (error message below).
Short error message:
cannot load the **** function: binding type "'client'" and dataType "durableClient" in the binding decorator do not match the corresponding function parameter's Python type annotation DurableOrchestrationClient .
azure-functions-durable version: 1.4.0 and 1.5.0
After some time debugging I was able to reveal the root cause. It is related to the Typehints.
# does not work
import azure.durable_functions as df
import azure.functions as func
@bp.event_grid_trigger(arg_name="azeventgrid")
@bp.durable_client_input(client_name="client")
async def my_function_name(
azeventgrid: func.EventGridEvent, client: df.DurableOrchestrationClient
) -> None:
# the typehint df.DurableOrchestrationClient is the root cause# does
import azure.durable_functions as df
import azure.functions as func
@bp.event_grid_trigger(arg_name="azeventgrid")
@bp.durable_client_input(client_name="client")
async def my_function_name(
azeventgrid: func.EventGridEvent, client
) -> None:
# removing the type hint is solving the issueBelow the full error message:
Microsoft.Azure.WebJobs.Script: Error building configuration in an external startup class. System.Private.CoreLib: One or more errors occurred. (Result: Failure Type: Exception: FunctionLoadError: cannot load the ****function: binding type "'client'" and dataType "durableClient" in the binding decorator do not match the corresponding function parameter's Python type annotation DurableOrchestrationClient Stack: Traceback (most recent call last): File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/handle_event.py", line 99, in worker_init_request load_function_metadata( ~~~~~~~~~~~~~~~~~~~~~~^ init_request.function_app_directory, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ caller_info="worker_init_request") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/handle_event.py", line 410, in load_function_metadata _metadata_result = (index_functions(function_path, function_app_directory)) \ ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/handle_event.py", line 420, in index_functions process_indexed_function( ~~~~~~~~~~~~~~~~~~~~~~~~^ protos, ^^^^^^^ _functions, ^^^^^^^^^^^ indexed_functions, ^^^^^^^^^^^^^^^^^^ function_dir)) ^^^^^^^^^^^^^ File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/loader.py", line 136, in process_indexed_function function_info = functions_registry.add_indexed_function( function=indexed_function, protos=protos) File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/functions.py", line 429, in add_indexed_function settlement_client_arg) = self.validate_function_params( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ params, ^^^^^^^ ...<2 lines>... func_name, ^^^^^^^^^^ protos) ^^^^^^^ File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/functions.py", line 270, in validate_function_params raise FunctionLoadError( ...<5 lines>... 'annotation ' + param_py_type.name) azure_functions_runtime.functions.FunctionLoadError: cannot load the **** function: binding type "'client'" and dataType "durableClient" in the binding decorator do not match the corresponding function parameter's Python type annotation DurableOrchestrationClient ). System.Private.CoreLib: Result: Failure Type: Exception: FunctionLoadError: cannot load the **** function: binding type "'client'" and dataType "durableClient" in the binding decorator do not match the corresponding function parameter's Python type annotation DurableOrchestrationClient Stack: Traceback (most recent call last): File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/handle_event.py", line 99, in worker_init_request load_function_metadata( ~~~~~~~~~~~~~~~~~~~~~~^ init_request.function_app_directory, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ caller_info="worker_init_request") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/handle_event.py", line 410, in load_function_metadata _metadata_result = (index_functions(function_path, function_app_directory)) \ ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/handle_event.py", line 420, in index_functions process_indexed_function( ~~~~~~~~~~~~~~~~~~~~~~~~^ protos, ^^^^^^^ _functions, ^^^^^^^^^^^ indexed_functions, ^^^^^^^^^^^^^^^^^^ function_dir)) ^^^^^^^^^^^^^ File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/loader.py", line 136, in process_indexed_function function_info = functions_registry.add_indexed_function( function=indexed_function, protos=protos) File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/functions.py", line 429, in add_indexed_function settlement_client_arg) = self.validate_function_params( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ params, ^^^^^^^ ...<2 lines>... func_name, ^^^^^^^^^^ protos) ^^^^^^^ File "/azure-functions-host/workers/python/3.14/LINUX/X64/azure_functions_runtime/functions.py", line 270, in validate_function_params raise FunctionLoadError( ...<5 lines>... 'annotation ' + param_py_type.name) azure_functions_runtime.functions.FunctionLoadError: cannot load the **** function: binding type "'client'" and dataType "durableClient" in the binding decorator do not match the corresponding function parameter's Python type annotation DurableOrchestrationClient .
🤔 Expected behavior
What should have happened?
The function should be able to startup without issues when using the type hint.
☕ Steps to reproduce
What Durable Functions patterns are you using, if any?
Any minimal reproducer we can use?
See above
Are you running this locally or on Azure?
On Azure
⚡If deployed to Azure
We have access to a lot of telemetry that can help with investigations. Please provide as much of the following information as you can to help us investigate!
- Timeframe issue observed:
- Function App name:
- Function name(s):
- Azure region:
- Orchestration instance ID(s):
- Azure storage account name:
If you don't want to share your Function App or storage account name GitHub, please at least share the orchestration instance ID. Otherwise it's extremely difficult to look up information.
There is no instance ID because the function was not able to start up