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

[azblob] BlobURLParts does not support VersionID #17188

Closed
hy3 opened this issue Feb 28, 2022 · 9 comments · Fixed by #17274
Closed

[azblob] BlobURLParts does not support VersionID #17188

hy3 opened this issue Feb 28, 2022 · 9 comments · Fixed by #17274
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage Storage Service (Queues, Blobs, Files)

Comments

@hy3
Copy link

hy3 commented Feb 28, 2022

Bug Report

  • import path of package: .../sdk/storage/azblob
  • SDK version: v0.3.0
  • go version: go1.17.6 darwin/amd64

I'm using Azure Blob Storage with version management, and want to download old version with this SDK. So, I tried to use BlobClient.WithVersionID() or BlobURLParts.VersionID , but both of them didn't work.
Because BlobURLParts outputs URL without VersionID, nevertheless preview SDK does it. ( ref. )

If it is as expected, please tell me how to download blob by Version ID with the SDK.
I avoiding this issue by editing URL directly, but It doesn't look smart way.

u, _ := url.Parse(blobClient.URL())

q := u.Query()
q.Set("versionId", versionID)
u.RawQuery = q.Encode()

newBlobClient, _ := azblob.NewBlobClient(u.String(), cred, nil)
@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 Feb 28, 2022
@mohsha-msft mohsha-msft self-assigned this Feb 28, 2022
@RickWinter RickWinter added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Feb 28, 2022
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Feb 28, 2022
@amishra-dev amishra-dev added feature-request This issue requires a new behavior in the product in order be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 1, 2022
@ghost ghost added the needs-team-attention This issue needs attention from Azure service team or SDK team label Mar 1, 2022
@amishra-dev
Copy link

Thanks for this report @hy3. Currently there maynot be a way to do this other than edit URL @mohsha-msft to confirm.

@mohsha-msft mohsha-msft linked a pull request Mar 2, 2022 that will close this issue
5 tasks
@mohsha-msft
Copy link
Contributor

Hey @hy3 ,

Thanks for reaching out!

Yes this is indeed a bug at our end. Somehow it got escaped from our tests. I apologize for inconvenience. I've raised a request to fix it and added more tests to make sure this doesn't happen in future. We'll ship it in next release. In the meantime, you can pull the changes from my branch by using the command

go get github.com/Azure/azure-sdk-for-go/sdk/storage/azblob@mohsha-msft-azblob-fix-versioning-bug

Please reach out for any clarification!

@hy3
Copy link
Author

hy3 commented Mar 3, 2022

@mohsha-msft @amishra-dev
Thanks for your reply. I got it. I'm looking forward to next release.

@hy3
Copy link
Author

hy3 commented Mar 3, 2022

@mohsha-msft
I found same bug on NewBlobURLParts() not only on BlobURLParts.URL() .
Your commit does not include it. Please fix it too.

This is example in azure-storage-blob-go .
https://github.com/Azure/azure-storage-blob-go/blob/b32b5e3579400739418747a71c4bffaf8a19c4a0/azblob/parsing_urls.go#L98-L103

@mohsha-msft mohsha-msft removed needs-team-attention This issue needs attention from Azure service team or SDK team feature-request This issue requires a new behavior in the product in order be resolved. labels Mar 3, 2022
@mohsha-msft mohsha-msft linked a pull request Mar 10, 2022 that will close this issue
5 tasks
@mohsha-msft
Copy link
Contributor

Fixed in main. Target release for next release.

@hy3, can you give it a try and let me know if the issue is persisting?

@hy3
Copy link
Author

hy3 commented Mar 14, 2022

@mohsha-msft
It works 🎉

However, through my trying, I found that BlobClient.WithVersionID() returns not BlobClient but BlockBlobClient .
Would you fix it too ?

screenshot

@mohsha-msft
Copy link
Contributor

mohsha-msft commented Mar 14, 2022

Yes that's correct. It'll be fixed too..

I'm glad it worked for your. I am sorry for the inconviniece caused. As you know we're still in preview version and still trying things. I will appreciate your efforts/feedbacks on the findings.

@hy3
Copy link
Author

hy3 commented Mar 15, 2022

Thanks a lot !

The SDK is already a big help for me. I'll continue to use it and give feedback on it.
I'm looking forward to its stable release 👍

@mohsha-msft
Copy link
Contributor

Hey @hy3 ,

azblob v0.4.0 is now publically available. I have fixed the issue here and here.

Please reach out and reopen the issue if it still persists.

Thanks a lot for your feedbacks!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants