Repository navigation
[Storage] Add source login authentication for synchronous blob copy - #34219
Dimitri Vasdekis (dvasdekis) wants to merge 3 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution Dimitri Vasdekis (@dvasdekis)! We will review the pull request and get back to you soon. |
|
@microsoft-github-policy-service agree |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Automated sensitive-information remediation ran on this pull request.
X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:
If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment. ✅ Confirm the finding · ❌ Dispute the finding GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices. |
|
Regarding the sensitive-information scan in #34219 (comment): both flagged lines assign the literal |
There was a problem hiding this comment.
🟡 Changes recommended
Token acquisition can fail when login mode is combined with destination key, SAS, or connection-string credentials.
1 open finding
What changed in this PR
Adds opt-in Entra authentication for synchronous server-side blob copies without generating a source SAS.
Changes:
- Adds
--source-auth-mode loginvalidation, help, and examples. - Forwards a storage-scoped bearer token to synchronous copy requests.
- Adds unit coverage for validation, endpoints, tokens, and existing behavior.
| File | Description |
|---|---|
_validators.py |
Validates source-login constraints and builds source URLs. |
_params.py |
Registers the new argument. |
_help.py |
Documents usage and provides an example. |
operations/blob.py |
Adds bearer authorization to copy requests. |
test_storage_blob_source_oauth.py |
Tests the new authentication path. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
❌ Redaction disputed by Dimitri Vasdekis (@dvasdekis). Automation is paused for maintainer review. X Engineering Agent will not restore the suspected value because doing so would publish it again. A maintainer can replace the placeholder with confirmed non-sensitive text after review. |
|
Automated sensitive-information remediation ran on this pull request.
X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:
If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment. ✅ Confirm the finding · ❌ Dispute the finding GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices. |
|
❌ Redaction disputed by Dimitri Vasdekis (@dvasdekis). Automation is paused for maintainer review. X Engineering Agent will not restore the suspected value because doing so would publish it again. A maintainer can replace the placeholder with confirmed non-sensitive text after review. |

Related command
az storage blob copy startDescription
Related to #28167 and #29039.
Add opt-in
--source-auth-mode loginfor synchronous copies of named source blobs. The existing login path generates a user-delegation SAS for the source. This option instead obtains a storage-scoped token from the signed-in credential and passes the SDK'ssource_authorizationparameter tostart_copy_from_url. Blob data remains server-side; no source account key or SAS is generated.Requires
--auth-mode loginand--requires-sync true. Supports the active cloud's storage endpoint and the SDK's standard storage OAuth scope. Rejects source URI, explicit source key/SAS, file sources, invalid account names, and destination blob type conversion. Existing copy behavior remains unchanged when the option is omitted.This is deliberately narrower than the linked issues: asynchronous and batch-copy behavior are not changed. Synchronous copies remain subject to Azure Storage service limits and network rules.
Testing Guide
Example using generic resource names:
az storage blob copy start --account-name destinationaccount --destination-container destinationcontainer --destination-blob example.txt --source-account-name sourceaccount --source-container sourcecontainer --source-blob example.txt --auth-mode login --source-auth-mode login --requires-sync trueThe signed-in identity needs blob read access at the source and write access at the destination.
Local validation:
git diff --checkpasses.Live synthetic validation passed between two private development storage accounts with shared-key access disabled: synchronous server-side copy returned success, copied bytes matched the synthetic source, and create-only collision was rejected. All test containers were removed. A live run also exposed an invalid cloud attribute lookup; the follow-up commit fixes it and adds a real-cloud-object regression test. No production data was used. Draft remains pending maintainer design review and a recorded integration scenario.
History Notes
[Storage]
az storage blob copy start: Add--source-auth-mode loginfor synchronous named-source blob copies without generating a SAS.