Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
An initialization/restart race can keep credential renewal running after stop completes, while migration blob options discard configured encryption settings.
2 open issues
What changed in this PR
Wires renewable migration SAS credentials into Azure Storage wrappers, building on #1447’s request policies. Existing service construction remains unchanged; migration activation comes later.
Changes:
- Adds cached SAS clients with shared initialization, renewal, timeout, and retry policies.
- Preserves original credentials for management operations and blocks whole-resource deletion during migration.
- Adds simulated SDK integration tests and updates the large-message blob check.
| File | Description |
|---|---|
test/DurableTask.AzureStorage.Tests/MigrationSasManagerTests.cs |
Tests renewal, drain, initialization recovery, management access, and retries. |
test/DurableTask.AzureStorage.Tests/AzureStorageScenarioTests.cs |
Checks blob existence directly through the SDK. |
src/DurableTask.AzureStorage/Storage/Table.cs |
Uses cached SAS clients for table data operations. |
src/DurableTask.AzureStorage/Storage/Queue.cs |
Uses cached SAS clients and guards queue management. |
src/DurableTask.AzureStorage/Storage/BlobContainer.cs |
Separates SAS data access from guarded container management. |
src/DurableTask.AzureStorage/Storage/Blob.cs |
Lazily obtains migration-aware blob clients. |
src/DurableTask.AzureStorage/Storage/AzureStorageClient.cs |
Coordinates initialization and constructs isolated SAS clients and policies. |
Review effort: Balanced
|
|
||
| public Task StopMigrationTokenRefreshAsync() | ||
| { | ||
| return this.migration?.StopRefreshing() ?? Task.CompletedTask; |
Comment on lines
+254
to
+255
| Audience = blobManagementOptions!.Audience, | ||
| GeoRedundantSecondaryUri = blobManagementOptions.GeoRedundantSecondaryUri, |
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.


Storage requests during migration need renewable SAS credentials so cached clients stop sending when migration is ending. Wire the existing migration credential manager and request policies into the queue, table, and blob wrappers. Clients share initialization, recover from failed initialization, and use refreshed credentials without being recreated. Migration data requests use the 30-second server timeout, disable generic SDK retries, and retain the single authentication retry.
Resource creation and container management retain the original credentials with an explicit access check. Deleting an entire task-hub queue, table, or container is rejected during migration. SAS policies use separate client options so they do not affect other clients sharing the provider.
This is extracted from
stevosyan/storage-migration, following #1447. Service startup will opt into these clients in a later PR; existing service construction does not enable migration. Experimental timing telemetry is excluded.Tests extend
MigrationSasManagerTestsusing real SDK clients with local simulated responses. The ten new cases cover cached-client renewal and drain rejection, shared-key and identity credentials, initialization retries, management access, ordinary-client isolation, and authentication retries for all three services. The existing large-message scenario helper now checks the blob through the SDK directly after the internal wrapper constructor change.Validation: 80 tests passed on .NET 8 and 80 on .NET Framework 4.8 (160 total), covering the credential manager, client integration, migration control, and storage client providers. No Azure account or emulator is needed for these tests.