Skip to content

Commit fd63eb7

Browse files
authored
Suppress execution context from token renewal (#2782)
* Suppress execution context from token renewal * update release_notes.md
1 parent 87239a1 commit fd63eb7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

release_notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
### Bug Fixes
2525

26+
- Fix execution context / log scope leak in token renewal (https://github.com/Azure/azure-functions-durable-extension/pull/2782)
27+
2628
### Breaking Changes
2729

2830
### Dependency Updates

src/WebJobs.Extensions.DurableTask/Auth/AzureCredentialFactory.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ public AppAuthTokenCredential Create(IConfiguration configuration, TimeSpan toke
7272
RefreshOffset = tokenRefreshOffset,
7373
};
7474

75+
// The token credential will make background callbacks to renew the token.
76+
// We suppress async flow to avoid logging scope from being captured as we do not know
77+
// where this will be called from first.
78+
using AsyncFlowControl flowControl = System.Threading.ExecutionContext.SuppressFlow();
7579
return new AppAuthTokenCredential(
7680
value.Token,
7781
(o, t) => this.RenewTokenAsync((TokenRenewalState)o, t),

0 commit comments

Comments
 (0)