Describe the bug
BLOB resource is uploaded.
Appending SAS query parameters generated by library to BLOB URL causes the request to fail.
Exception or Stack Trace
AuthenticationFailed
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:485024e3-301e-0001-07c3-b151e6000000 Time:2019-12-13T14:42:24.2855114Z
Signature fields not well formed.
To Reproduce
Using generated SAS token causes intermittent failures.
- generate SAS query parameters.
- append to blob url
- Try to access the resource with the signed url.
Code Snippet
library dependency: "com.azure" % "azure-storage-blob" % "12.1.0"
- Generate SAS quary params:
new BlobServiceSasSignatureValues()
.setExpiryTime(now().plusDays(conf.urlExpirationDays).toOffsetDateTime)
.setPermissions(new BlobSasPermission().setReadPermission(true))
.setContainerName(conf.container)
.setBlobName(key)
.generateSasQueryParameters(userDelegationKey(conf.urlExpirationDays), conf.storageAccount)
.encode()
- upload resource to blob
- blockBlobClient.getBlobUrl + s"?$sharedAccessSignature"
Expected behavior
Every time the generated blob URL with SAS signature should be accessible
Additional context
I already checked below merged issues but did not help:
I observed some pattern for working url's and not working url's. the difference is only with sig parameter. not working one has + character in them.
Not Working:
sig=HnFiNxSp0BSvS+eg+bf5wHxOmxQJaPVqnqs81D+N6Eo=
sig=16TuQ7fhMNanms7x5W%2Fg+NzCRLfseDFDgB88rmb+XjU=
sig=8qgQKxaVnl0nUxX15bRt4VG7yxc7+Ppf9PqsPsxq5rE=
sig=Zfi3rhFiaD1zpY76kWIqRzJQ3Bl77%2F1b2DheP0wyN+E=
sig=Zfi3rhFiaD1zpY76kWIqRzJQ3Bl77%2F1b2DheP0wyN+E=
sig=D+EM63VkJc9wywZMH0sENjQVAHW8tiuCYbBMFeGfle4=
sig=OWVAzg0wAeS3r1MzIZkn+l8SbGKbKPrhjwa%2FdWbmoi8=
sig=q9+nQ1GSGWye9b318AJpFHHLWq4L0KQJzfazwku4MoM=
sig=v+w6XJSTzt%2FLvfNi7%2Flyy2hXMLI7AUgQ7e36BnYIDEc=
Working:
sig=r6GMuEPjB0dnxGHuGOX0F2ze3401ewntxK9T8JY%2FokA=
sig=IBzeKJBjnIN7vneV7JzhY8ZaqQKYD299rcj6i%2FecXGY=
Describe the bug
BLOB resource is uploaded.
Appending SAS query parameters generated by library to BLOB URL causes the request to fail.
Exception or Stack Trace
AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:485024e3-301e-0001-07c3-b151e6000000 Time:2019-12-13T14:42:24.2855114Z
Signature fields not well formed.
To Reproduce
Using generated SAS token causes intermittent failures.
Code Snippet
library dependency: "com.azure" % "azure-storage-blob" % "12.1.0"
new BlobServiceSasSignatureValues()
.setExpiryTime(now().plusDays(conf.urlExpirationDays).toOffsetDateTime)
.setPermissions(new BlobSasPermission().setReadPermission(true))
.setContainerName(conf.container)
.setBlobName(key)
.generateSasQueryParameters(userDelegationKey(conf.urlExpirationDays), conf.storageAccount)
.encode()
Expected behavior
Every time the generated blob URL with SAS signature should be accessible
Additional context
I already checked below merged issues but did not help:
I observed some pattern for working url's and not working url's. the difference is only with sig parameter. not working one has
+character in them.Not Working:
sig=HnFiNxSp0BSvS+eg+bf5wHxOmxQJaPVqnqs81D+N6Eo=
sig=16TuQ7fhMNanms7x5W%2Fg+NzCRLfseDFDgB88rmb+XjU=
sig=8qgQKxaVnl0nUxX15bRt4VG7yxc7+Ppf9PqsPsxq5rE=
sig=Zfi3rhFiaD1zpY76kWIqRzJQ3Bl77%2F1b2DheP0wyN+E=
sig=Zfi3rhFiaD1zpY76kWIqRzJQ3Bl77%2F1b2DheP0wyN+E=
sig=D+EM63VkJc9wywZMH0sENjQVAHW8tiuCYbBMFeGfle4=
sig=OWVAzg0wAeS3r1MzIZkn+l8SbGKbKPrhjwa%2FdWbmoi8=
sig=q9+nQ1GSGWye9b318AJpFHHLWq4L0KQJzfazwku4MoM=
sig=v+w6XJSTzt%2FLvfNi7%2Flyy2hXMLI7AUgQ7e36BnYIDEc=
Working:
sig=r6GMuEPjB0dnxGHuGOX0F2ze3401ewntxK9T8JY%2FokA=
sig=IBzeKJBjnIN7vneV7JzhY8ZaqQKYD299rcj6i%2FecXGY=