Repository navigation
Add migration SAS renewal and drain handling - #1444
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical expiry checks can publish already-expired SAS credentials after delayed reads and continue returning them after renewal fails, causing authentication failures instead of the intended unavailability exception.
2 open issues
What changed in this PR
Adds internal SAS renewal and drain handling for Azure Storage migration. The manager has no runtime caller yet; workload-client integration remains separate.
Changes:
- Adds short-lived SAS renewal using Storage time, conditional control-row updates, cached delegation keys, and in-place credential updates.
- Introduces an unavailable-service exception and upgrades Azure.Storage.Queues for delegation-key support.
- Adds simulated Storage tests covering renewal, drain races, failures, cancellation, and refresh-loop lifecycle.
| File | Description |
|---|---|
| test/DurableTask.AzureStorage.Tests/MigrationSasManagerTests.cs | Tests renewal and drain handling using local SDK responses. |
| src/DurableTask.AzureStorage/Storage/MigrationSasManager.cs | Implements credential renewal, caching, and drain detection. |
| src/DurableTask.AzureStorage/OrchestrationServiceUnavailableException.cs | Defines the exception for unavailable backend access. |
| Directory.Packages.props | Updates Azure.Storage.Queues to 12.25.0. |
Review effort: Balanced
halspang
reviewed
Nov 25, 2026
halspang
approved these changes
Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Migration hosts need to renew short-lived Storage SAS credentials while migration is active and stop renewing when the control row closes. Add the internal MigrationSasManager from stevosyan/storage-migration: it uses Storage's clock, publishes a 15-second expiry with an ETag-conditional update, reuses delegation keys, and updates cached credential objects. A drain that wins the ETag race prevents renewal.
This PR also adds OrchestrationServiceUnavailableException and updates Azure.Storage.Queues to 12.25.0 for Queue user delegation keys. Production behavior is unchanged from the integration branch. The manager has no runtime caller yet; workload-client wiring and request policies follow separately. No detailed performance telemetry is included.
Validation: 71 tests passed on each of .NET 8 and .NET Framework 4.8 (142 total), including 17 new renewal-manager cases. Coverage includes shared-key and identity credentials, the renewal margin, competing renewals/drain, missing control rows, failed and slow key acquisition, cancellation, and refresh-loop stop/restart. Tests use real SDK pipelines with simulated local Storage responses and do not contact Azure.