I have successfully managed to setup an Azure Durable function and I can execute it and see the http trigger activates, evidenced by the log files. I can also see the orchestrator_trigger being called.
I have setup the configuration settings to enable the v2 programming model:
AzureWebJobsFeatureFlags=EnableWorkerIndexing
As per the instructions here Here's the code
import json
import logging
from typing import Any
import azure.functions as func
import azure.durable_functions as df
myapp = df.Blueprint(http_auth_level=func.AuthLevel.ANONYMOUS)
@myapp.route(route="synthetic/solar/snapshot")
@myapp.durable_client_input(client_name="client")
async def http_start(req: func.HttpRequest, client):
function_name = 'my_orchestrator_function'
instance_id = await client.start_new(function_name)
response = client.create_check_status_response(req, instance_id)
return response
@myapp.orchestration_trigger(context_name="context")
def my_orchestrator_function(context):
test_act_data = {"testdata": "test"}
test_serialised_act_data = json.dumps(test_act_data)
logging.info(f"Activity result: {test_serialised_act_data}")
test_result = yield context.call_activity("hello_activity", test_serialised_act_data)
return test_result
@myapp.activity_trigger(input_name="test_json")
def hello_activity(test_json: str):
json_activity_data = json.loads(test_json)
data = json_activity_data["testdata"]
logging.info("Hello Test, Executing Activity Trigger")
return data
My host.json:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}
And function_app.py:
import azure.functions as func
app = func.FunctionApp()
app.register_functions(myapp)
I've tried improving the logging. I've tried to step through the stages and refer to lots of examples, but there's really no hint as to why the activity_trigger isn't being triggered.



