Skip to content

[Storage] put_blob_from_url for BlobClient #2936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vincenttran-msft
Copy link
Member

@vincenttran-msft vincenttran-msft commented Aug 20, 2025

.tsp: Azure/azure-rest-api-specs#36847

  • Initial introduction of put_blob_from_url
  • Adds some more models found in options bag missed in initial implementation
  • Refactors create_test_blob utility to accept data but still have a fallback for simple cases

BlockBlobClientPutBlobFromUrlResultHeaders
̶d̶a̶t̶e̶
content_md5
last_modified
etag
encryption_key_sha256
encryption_scope
is_server_encrypted
version_id

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Aug 20, 2025
Copy link

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure_storage_blob

/// `https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=<DateTime>`
/// `https://otheraccount.blob.core.windows.net/mycontainer/myblob?sastoken`
/// * `options` - Optional configuration for the request. See [`BlockBlobClientPutBlobFromUrlOptionsExt`](crate::models::BlockBlobClientPutBlobFromUrlOptionsExt) for additional usage helpers.
pub async fn put_blob_from_url(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go on BlockBlobClient since its Block Blob specific.

/// `https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=<DateTime>`
/// `https://otheraccount.blob.core.windows.net/mycontainer/myblob?sastoken`
/// * `options` - Optional configuration for the request. See [`BlockBlobClientPutBlobFromUrlOptionsExt`](crate::models::BlockBlobClientPutBlobFromUrlOptionsExt) for additional usage helpers.
pub async fn put_blob_from_url(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this to upload_from_url

fn with_if_not_exists(self) -> Self;
}

impl BlockBlobClientPutBlobFromUrlOptionsExt for BlockBlobClientPutBlobFromUrlOptions<'_> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this without an extension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants