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 customer-reported Storage

Comments

@hy3
Copy link

@hy3 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)
@msftbot msftbot bot added needs-triage customer-reported question labels Feb 28, 2022
@mohsha-msft mohsha-msft self-assigned this Feb 28, 2022
@RickWinter RickWinter added Client Storage labels Feb 28, 2022
@msftbot msftbot bot removed the needs-triage label Feb 28, 2022
@amishra-dev amishra-dev added feature-request and removed question labels Mar 1, 2022
@msftbot msftbot bot added the needs-team-attention label Mar 1, 2022
@amishra-dev
Copy link

@amishra-dev amishra-dev commented Mar 1, 2022

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
Member

@mohsha-msft mohsha-msft commented Mar 2, 2022

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 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 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 feature-request 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
Member

@mohsha-msft mohsha-msft commented Mar 10, 2022

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 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
Member

@mohsha-msft 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 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
Member

@mohsha-msft mohsha-msft commented Apr 20, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client customer-reported Storage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants