Closed malyalavenu closed 2 months ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.
The error message is coming from the platform, not something the SDK is throwing:
I'm guessing it happens here: https://github.com/Azure/azure-sdk-for-js/blob/d133eaf30319a2bca14661c2a5bca2c995b6b9ef/sdk/core/core-client/src/urlHelpers.ts#L266
The URL you have provided doesn't appear to be invalid, at least not unless the invalid part is coming from one of the pieces you redacted. Does the URL constructor throw for you when you provide the full unredacted URL?
I think the issue is with the SAS token on the ruby side. I tried the same with a node app and it works fine
I notice you are using URI.encode_www_form
which reminded me that there were some subtleties in the ways that formdata is encoded that is different from how we expect URL query parameters to be encoded, specifically around encoding the +
character as a space, which causes trouble with base64 data: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams#preserving_plus_signs
So if I had to guess, the sig
parameter isn't being encoded properly by URI.encode_www_form
which is why it is producing an invalid SAS URL.
Hi @malyalavenu. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @malyalavenu, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
I am trying to do a multi-part upload to azure blob store from a ruby on rails app that uses
dropzone.js
,stimulus.js
andDirectUpload
from@rails/activestorage
. Below are the version and package/gem information. Active storage currently doesn't support multi-part upload for large files (>256 MB) to azure blob store. So I am trying to replace the@rails/activestorage
functionality with@azure/storage-blob
I have an import as below in my
dropzone_controller.js
Below is the code to do the multipart upload
The URL formed is as follows. I removed the sensitive information
https://<azure-storage-account-name>.blob.core.windows.net/<azure-container-name>/large_image1.jpg?sv=2018-11-09&sr=b&sp=rw&se=2024-07-05T06%3A41%3A23Z&st=2024-07-05T05%3A11%3A23Z&spr=https&sig=<sas_token_signature>
This is throwing an error of Invalid URL and I could trace it as per the console message in the following method
blockBlobClient.uploadData();
I was able to trace it, but not able to figure why this is happeningI am requesting help on two things: 1) Why is this error happening ? 2) Can there be a more descriptive error message, like invalid SAS token if it is, or as per the error
Gemfile
package.json
I am generating a
SAS token
using the following ruby controller codeHere is the
routes.rb
code forgenerate_sas_token