Title: Performance [P2]: Defer synchronous Azure token acquisition · Issue #187 · microsoft/durabletask-python · GitHub
Open Graph Title: Performance [P2]: Defer synchronous Azure token acquisition · Issue #187 · microsoft/durabletask-python
X Title: Performance [P2]: Defer synchronous Azure token acquisition · Issue #187 · microsoft/durabletask-python
Description: What is the issue? Constructing a synchronous Azure managed interceptor performs a potentially blocking credential request before any RPC is made. What is the impact? Client and worker startup latency includes an authentication round tri...
Open Graph Description: What is the issue? Constructing a synchronous Azure managed interceptor performs a potentially blocking credential request before any RPC is made. What is the impact? Client and worker startup late...
X Description: What is the issue? Constructing a synchronous Azure managed interceptor performs a potentially blocking credential request before any RPC is made. What is the impact? Client and worker startup late...
Opengraph URL: https://github.com/microsoft/durabletask-python/issues/187
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Performance [P2]: Defer synchronous Azure token acquisition","articleBody":"### What is the issue?\n\nConstructing a synchronous Azure managed interceptor performs a potentially blocking credential request before any RPC is made.\n\n### What is the impact?\n\nClient and worker startup latency includes an authentication round trip even when the instance is never used. This especially affects short-lived tools, tests, and applications that construct clients eagerly. For normal long-lived clients, this moves rather than eliminates first-request latency.\n\n### Details about the issue including code reference\n\nRelevant code:\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask-azuremanaged/durabletask/azuremanaged/internal/access_token_manager.py#L17-L27\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask-azuremanaged/durabletask/azuremanaged/internal/durabletask_grpc_interceptor.py#L44-L50\n\n`AccessTokenManager.__init__()` calls `credential.get_token()`. `DTSDefaultClientInterceptorImpl.__init__()` creates that manager and immediately calls `get_access_token()`.\n\n### A potential or proposed solution\n\nDefer token acquisition until the first intercepted RPC and retain cached refresh-before-expiry behavior. Consider an explicit warm-up option if fail-fast authentication during construction is an intended contract, because lazy acquisition changes when authentication failures surface.\n\n### Cold-start relevance\n\nThis is the primary direct startup cost for synchronous Azure managed clients and workers: construction invokes the credential before the first RPC. With DefaultAzureCredential or ManagedIdentityCredential, that can include environment probing or a network token request. SandboxWorker passes its managed-identity credential through this same synchronous construction path.\n\nRelevant code:\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask-azuremanaged/durabletask/azuremanaged/worker.py#L92-L117\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask-azuremanaged/durabletask/azuremanaged/preview/sandboxes/worker.py#L43-L64","author":{"url":"https://github.com/berndverst","@type":"Person","name":"berndverst"},"datePublished":"2026-07-24T20:50:21Z","url":"https://github.com/microsoft/durabletask-python/issues/187"}
| 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:d83a2a31-6b20-9a53-8401-40683ec0dde8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80AC:3ED8DE:FBA9D:1453CB:6AFE44AE |
| html-safe-nonce | f7ebbfa2707d1efc09f292f9bf64d85cbd856e1fff5180931574443f846d44d0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEFDOjNFRDhERTpGQkE5RDoxNDUzQ0I6NkFGRTQ0QUUiLCJ2aXNpdG9yX2lkIjoiMTc4NTkxOTQ1MTU0ODIzOTAyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b77dbce9369461ac62ea584a21b3d1caff14b6799203cabf1edcc1c07433570a |
| hovercard-subject-tag | issue:4971936623 |
| 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/187/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e865ad953585cc48b1f6375194d8e50a6fae2776ab098623d17a2b15fe161784/microsoft/durabletask-python/issues/187 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e865ad953585cc48b1f6375194d8e50a6fae2776ab098623d17a2b15fe161784/microsoft/durabletask-python/issues/187 |
| og:image:alt | What is the issue? Constructing a synchronous Azure managed interceptor performs a potentially blocking credential request before any RPC is made. What is the impact? Client and worker startup late... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | berndverst |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1a5901e2377b0af2a0b303f9528678f1475d04b9219dca1e993344196eaa07c |
| 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 | ce393ea11ad276623b946bc9663d3e7d6f564275 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width