Which service(blob, file, queue, table) does this issue concern?
Queue
Which version of the Azurite was used?
Azurite-Queue/3.12.0
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
DockerHub
What's the Node.js version?
Unknown
What problem was encountered?
HTTP 403 for calls on QueueClient if SAS uri is used for initialization.
Steps to reproduce the issue?
var incomingQueueClient = new QueueClient("UseDevelopmentStorage=true", "test-queue", new QueueClientOptions() { MessageEncoding = QueueMessageEncoding.Base64 });
await incomingQueueClient.CreateIfNotExistsAsync();
var builder = new QueueSasBuilder
{
//StartsOn = DateTimeOffset.UtcNow.AddDays(-1),
ExpiresOn = DateTimeOffset.UtcNow.AddDays(2)
};
builder.SetPermissions(QueueSasPermissions.All);
var sasUri = incomingQueueClient.GenerateSasUri(builder);
var sasGeneratedQueue = new QueueClient(sasUri, new QueueClientOptions() { MessageEncoding = QueueMessageEncoding.Base64 });
await sasGeneratedQueue.ReceiveMessagesAsync(12); // this calls fails with HTTP 403
Have you found a mitigation/solution?
If you set a start for the SAS builder the call is successfull.
Which service(blob, file, queue, table) does this issue concern?
Queue
Which version of the Azurite was used?
Azurite-Queue/3.12.0
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
DockerHub
What's the Node.js version?
Unknown
What problem was encountered?
HTTP 403 for calls on QueueClient if SAS uri is used for initialization.
Steps to reproduce the issue?
var incomingQueueClient = new QueueClient("UseDevelopmentStorage=true", "test-queue", new QueueClientOptions() { MessageEncoding = QueueMessageEncoding.Base64 }); await incomingQueueClient.CreateIfNotExistsAsync(); var builder = new QueueSasBuilder { //StartsOn = DateTimeOffset.UtcNow.AddDays(-1), ExpiresOn = DateTimeOffset.UtcNow.AddDays(2) }; builder.SetPermissions(QueueSasPermissions.All); var sasUri = incomingQueueClient.GenerateSasUri(builder); var sasGeneratedQueue = new QueueClient(sasUri, new QueueClientOptions() { MessageEncoding = QueueMessageEncoding.Base64 }); await sasGeneratedQueue.ReceiveMessagesAsync(12); // this calls fails with HTTP 403
Have you found a mitigation/solution?
If you set a start for the SAS builder the call is successfull.
The problem is the if statement here that expects a start and expiry date. https://github.com/Azure/Azurite/blob/dbe5b715b94c52c1084e260ba312c88d3eb6c3d5/src/queue/authentication/QueueSASAuthenticator.ts#L329. But the documentation of Azure allows to omit the start date.