Skip to content
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

[FEATURE REQ] [Blob Storage] Return properties of blob uploaded using EncryptedBlobClient #10685

Closed
2 tasks done
SukruthKS opened this issue May 4, 2020 · 5 comments · Fixed by #11433
Closed
2 tasks done
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)

Comments

@SukruthKS
Copy link

Is your feature request related to a problem? Please describe.
I use synchronous version of the blob clients in the storage SDK (v12.6.0). When a blob is uploaded using BlockBlobClient, it returns a BlockBlobItem that contains the properties of the uploaded blob like content MD5, ETag etc. But when EncryptedBlobClient is used instead for client-side encrypting the blob before uploading, it does not return these properties. So I have to make an additional call to download these properties.

Describe the solution you'd like
Expose the properties returned by the storage service with the PUT request so the application doesn't have to make an additional call.

Describe alternatives you've considered
I couldn't find an alternative that avoids additional calls.

Additional context
Signature of upload API exposed by BlockBlobClient:

public Response<BlockBlobItem> uploadWithResponse(InputStream data, long length, BlobHttpHeaders headers,
        Map<String, String> metadata, AccessTier tier, byte[] contentMd5, BlobRequestConditions requestConditions,
        Duration timeout, Context context);

Signature of upload API exposed by EncryptedBlobClient:

public void uploadWithResponse(InputStream data, long length, ParallelTransferOptions parallelTransferOptions,
        BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions,
        Duration timeout, Context context);

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Description Added
  • Expected solution specified
@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 4, 2020
@alzimmermsft alzimmermsft added feature-request This issue requires a new behavior in the product in order be resolved. Storage Storage Service (Queues, Blobs, Files) labels May 4, 2020
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label May 4, 2020
@rickle-msft
Copy link
Contributor

Hi, @SukruthKS. Thank you for reporting this. We should be able to make this update. Can you let us know the urgency of this request and if it is a blocker for you right now so we can prioritize it appropriately?

For future dev reference: This upload method is actually inherited from BlobClient, and that method doesn't return a BlobItem because it uploads by internally writing to a BlobOutputStream, which doesn't give any of these properties back. We should be able to resolve this issue by having the BlobOutputStream store these properties either on the create (Append and Page) or on the commit (Block) and then allowing the customer to get those properties in one of two ways. 1. We can add another overload of close to BlobOutputStream which returns a BlobItem. This isn't standard to the OutputStream interface, which isn't great, but is more concise and guarantees there's always something to return. 2. We can add a getBlobItem method to the type which returns the desired values. This doesn't muck with the OutputStream interface at all, but it does require a separate method call (though not a network request), and it could be possible for blockBlobs in particular that it return null if it is called before closing the stream.

@rickle-msft
Copy link
Contributor

We should also probably take this opportunity to address #8822 while we're at it.

@SukruthKS
Copy link
Author

Hello @rickle-msft,

Can you let us know the urgency of this request and if it is a blocker for you right now so we can prioritize it appropriately?

It's not a blocker right now and getting around it by making another request to fetch the properties. We are still in the testing phases for upgrading the storage SDK.

@rickle-msft
Copy link
Contributor

Thank you for that information. Given that it's early in the month, I think there's a good chance we can get this in for the June release (May just happened), though that may change based on some work for upcoming service features. I'll keep you posted, and please let us know if this in any way approaches becoming a blocker for you.

@SukruthKS
Copy link
Author

SukruthKS commented May 20, 2020

Hey @rickle-msft, this has now become a blocker. I just discovered some application code paths which have write-only credentials to storage so I cannot make that additional call to download blob properties.

Also, as per our discussion in #11231, I'll be using BlobClient instead of BlockBlobClient for uploads so this support needs to be added for BlobClient along with EncryptedBlobClient.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants