Title: [azure-functions-durable] Orchestrator context parameter name is fixed to `context`, blocking access to `func.Context` · Issue #171 · microsoft/durabletask-python · GitHub
Open Graph Title: [azure-functions-durable] Orchestrator context parameter name is fixed to `context`, blocking access to `func.Context` · Issue #171 · microsoft/durabletask-python
X Title: [azure-functions-durable] Orchestrator context parameter name is fixed to `context`, blocking access to `func.Context` · Issue #171 · microsoft/durabletask-python
Description: Summary In the azure-functions-durable (V2) package, the parameter that receives the orchestration context is effectively hardcoded to the name context. As a consequence: A user-supplied context_name other than "context" on @app.orchestr...
Open Graph Description: Summary In the azure-functions-durable (V2) package, the parameter that receives the orchestration context is effectively hardcoded to the name context. As a consequence: A user-supplied context_na...
X Description: Summary In the azure-functions-durable (V2) package, the parameter that receives the orchestration context is effectively hardcoded to the name context. As a consequence: A user-supplied context_na...
Opengraph URL: https://github.com/microsoft/durabletask-python/issues/171
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[azure-functions-durable] Orchestrator context parameter name is fixed to `context`, blocking access to `func.Context`","articleBody":"## Summary\n\nIn the `azure-functions-durable` (V2) package, the parameter that receives the\norchestration context is effectively hardcoded to the name `context`. As a\nconsequence:\n\n- A user-supplied `context_name` other than `\"context\"` on\n `@app.orchestration_trigger(...)` does not work — the host cannot bind the\n trigger to the generated handle.\n- There is no way for an orchestrator to also receive an\n `azure.functions.Context` (`func.Context`) parameter, because the Functions\n host injects `func.Context` only into a parameter named exactly `context`\n that is *not* a trigger binding — and that name is always consumed by the\n orchestrationTrigger binding.\n\nThis matches V1 behavior (see \"Not a regression\" below), so it is **not** a\nregression introduced by V2. Filing this to track it as a potential V2\nimprovement to be considered after the Functions PR merges and the beta\nrelease ships.\n\n## Mechanism / relevant code paths\n\nThe Azure Functions host binds a trigger to a function parameter **by name**,\nand it inspects the *generated handle* (not the user's function).\n\n1. The trigger binding is registered with `name=context_name`:\n - `azure/durable_functions/decorators/durable_app.py` —\n `orchestration_trigger(context_name, ...)` calls\n `OrchestrationTrigger(name=context_name, ...)`.\n\n2. The generated handle that the host actually indexes hardcodes a parameter\n literally named `context`:\n - `azure/durable_functions/orchestrator.py` — `Orchestrator.create`:\n ```python\n def handle(context: func.OrchestrationContext) -> str:\n return Orchestrator(fn).handle(context)\n ```\n - The parameter must be annotated `azure.functions.OrchestrationContext`\n for the host's orchestrationTrigger binding converter to accept it.\n\n3. Because the host matches the binding `name` (`context_name`) to a parameter\n of `handle` by name, they only line up when `context_name == \"context\"`.\n Any other `context_name` leaves the trigger unbound.\n\n4. `func.Context` injection: the Python worker injects `func.Context` only into\n a parameter named exactly `context` that is not itself a trigger binding.\n Since the orchestrationTrigger always occupies the `context` name, there is\n no free `context` parameter for `func.Context` to be injected into.\n\n5. Separately, durabletask's executor invokes the user's orchestrator as\n `fn(ctx, input)` — there is no slot in that calling convention for a\n `func.Context` object to be passed through to user code.\n\n## Not a regression (V1 parity)\n\nV1 has the same structural constraint. In\n`azure-functions-durable-python`'s `azure/durable_functions/orchestrator.py`,\n`Orchestrator.create` also registers a single-parameter\n`def handle(context: func.OrchestrationContext)`, so a V1 orchestrator could\nnever receive a working `func.Context` parameter either. V2 preserves this\nbehavior.\n\n## Related parity gap: `function_context` contents\n\nThe V1-compat `DurableOrchestrationContext` adapter currently exposes an empty\n`function_context`. V1's `function_context` is **not** necessarily empty: in\n`azure/durable_functions/models/DurableOrchestrationContext.py`, `__init__`\nconsumes a fixed set of named fields (`history`, `instanceId`, `isReplaying`,\n`parentInstanceId`, `input`, `upperSchemaVersion`, `maximumShortTimerDuration`,\n`longRunningTimerIntervalDuration`, `upperSchemaVersionNew`) and funnels every\nremaining field of the orchestration-trigger JSON into\n`FunctionContext(**kwargs)`. As of today the WebJobs extension injects at least\none such field — `defaultHttpAsyncRequestSleepTimeMillseconds` (observed value\n`30000`, the durable-HTTP async polling interval) — so a live V1\n`function_context` carries that value.\n\nV2 receives the orchestration input via a protobuf trigger that does not carry\nthese arbitrary extra fields, so the compat adapter has no source to populate\n`function_context` from. This is a minor parity gap to consider alongside the\ncontext-name / `func.Context` work above.\n\n## Notes\n\n- Out of scope for the current parity-focused Functions PR; capturing here so\n it can be picked up as a V2 improvement after the beta release.","author":{"url":"https://github.com/andystaples","@type":"Person","name":"andystaples"},"datePublished":"2026-07-09T16:14:14Z","url":"https://github.com/microsoft/durabletask-python/issues/171"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:76e2c4bb-18da-4fd6-5b28-61c02214d98a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E270:1E65E1:6805D:8FDB7:6AFE1E8C |
| html-safe-nonce | 8fad056bd9151c8266f6c79ecbf9a30c4502698472f2c199b4ad889024237678 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjcwOjFFNjVFMTo2ODA1RDo4RkRCNzo2QUZFMUU4QyIsInZpc2l0b3JfaWQiOiI3NjQzNzAyNzU1MzExMDk5NTMyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 23231d3c7e3b23f2cdcdcd14016da641169e9906b02074917237739e1df397ed |
| hovercard-subject-tag | issue:4847951130 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/durabletask-python/171/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1df886d4042c7d5f901ca60b21dc2135ff605d28e27ccbb9e5c834ed3d57f0e8/microsoft/durabletask-python/issues/171 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1df886d4042c7d5f901ca60b21dc2135ff605d28e27ccbb9e5c834ed3d57f0e8/microsoft/durabletask-python/issues/171 |
| og:image:alt | Summary In the azure-functions-durable (V2) package, the parameter that receives the orchestration context is effectively hardcoded to the name context. As a consequence: A user-supplied context_na... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andystaples |
| hostname | github.com |
| expected-hostname | github.com |
| None | d0525ab1464526bf4532a5551aa348cf100dff75ef808a96fc67a08b1d946aa9 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/durabletask-python git https://github.com/microsoft/durabletask-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 627664515 |
| octolytics-dimension-repository_nwo | microsoft/durabletask-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627664515 |
| octolytics-dimension-repository_network_root_nwo | microsoft/durabletask-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fef3993a71fa20f7be8e167132fbf9619bc66e12 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width