I have a project with an Azure function that have two http triggers functions.
import azure.functions as func
from func_utils.main_func import http_trigger_function
from func_utils.get_data_trigger import main_second_trigger_func
#Instantiate the HTTP Function app
app = func.FunctionApp(http_auth_level=func.AuthLevel.FUNCTION)
@app.route(route="http_trigger_function")
def http_trigger_func(req: func.HttpRequest, context) -> func.HttpResponse:
return http_trigger_function(req, context)
# Segundo HTTP Trigger
@app.route(route="get-data")
def main_second_trigger(req: func.HttpRequest) -> func.HttpResponse:
return main_second_trigger_func(req)
I want to use durable functions and do something like this:
def http_trigger(req: func.HttpRequest, starter: str) -> func.HttpResponse:
"""HTTP trigger to start the orchestration."""
client = df.DurableOrchestrationClient(starter)
order_details = req.get_json()
# Start the orchestration
instance_id = client.start_new("orchestrator_function", None, order_details)
return func.HttpResponse(f"Orchestration started with ID = {instance_id}")
I just declared the starter in my function like that example, without use the starter in this moment just to see how it works. But i am having this error when tried to start the function:
Worker failed to index functions
[2024-11-28T23:08:32.196Z] Result: Failure
Exception: FunctionLoadError: cannot load the http_trigger_func function: the following parameters are declared in Python but not in function.json: {'starter'}
Stack: File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.11\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 413, in _handle__functions_metadata_request
self.load_function_metadata(
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.11\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 393, in load_function_metadata
self.index_functions(function_path, function_app_directory)) \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.11\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 773, in index_functions
loader.process_indexed_function(
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.11\WINDOWS\X64\azure_functions_worker\loader.py", line 139, in process_indexed_function
function_info = functions_registry.add_indexed_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.11\WINDOWS\X64\azure_functions_worker\functions.py", line 450, in add_indexed_function
deferred_bindings_enabled) = self.validate_function_params(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.11\WINDOWS\X64\azure_functions_worker\functions.py", line 137, in validate_function_params
raise FunctionLoadError(
This is my host.json:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.*, 4.0.0)"
},
"extensions": {
"http": {
"routePrefix": "api",
"hsts": {
"isEnabled": true,
"includeSubDomains": true,
"maxAge": "365"
},
"customHeaders": {
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "DENY",
"X-XSS-Protection": "1; mode=block",
"Content-Security-Policy": "default-src 'self'",
"X-Content-Security-Policy": "default-src 'self'"
}
},
"durableTask": {
"hubName": "DurableFunctionsHub",
"maxConcurrentActivityFunctions": 10,
"maxConcurrentOrchestratorFunctions": 10
}
}
}
I don't have a function.json
I have tried to declare the starter as follows:
starter: df.DurableOrchestrationClient
But it doesn't work

