Azure / Azure/Azurite

The error returned in Azurite is inconsistent with the one in Azure when use queue service SAS to create queue

Open
#662 3 comments 0 reactions 1 assignee Claimed by @Poku8 View on GitHub
alignment NewArch queue-storage stale
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

**Error Description:**
The error returned in Azurite is inconsistent with the one in Azure when use queue service SAS to create queue.
In Azure, the error is shown as following:
![Screenshot 2020-12-15 154248](https://user-images.githubusercontent.com/20970631/102185619-4eca0b00-3eec-11eb-9aec-4b27f09f342c.png)
In Azurite, the error is shown as following:
![Screenshot 2020-12-15 152342](https://user-images.githubusercontent.com/20970631/102184091-da8e6800-3ee9-11eb-9071-7c266454fa32.png)

**To Reproduce**
The demo code is shown as following:
```
import { QueueServiceClient } from "@azure/storage-queue"
import * as assert from "assert"

async function main() {
try {
var queueServiceClient = new QueueServiceClient("https://jacksonstorage1211.queue.core.windows.net/?sv=2020-04-08&st=2020-12-15T06:40:44Z&se=2020-12-15T08:40:44Z&sp=raup&sig=NQHenjCUuSLq%2FnOpCAsV3vQxQSnuLYuO%2FuggG1ddiis%3D");
var queue = queueServiceClient.getQueueClient("");
await queue.create();
} catch (err) {
assert.ok((err as any).response.parsedBody.Code === "AuthorizationFailure");
}

try {
queueServiceClient = new QueueServiceClient("https://127.0.0.1:10001/devstoreaccount1/?sv=2020-04-08&st=2020-12-15T06%3A20%3A34Z&se=2020-12-15T08%3A20%3A34Z&sp=raup&sig=4RU5eN6Dhy%2B8MAcK29rt6gsue%2FW1iOl0dqfyKfR8p6s%3D")
queue = queueServiceClient.getQueueClient("");
await queue.create();
} catch (err) {
assert.ok((err as any).response.parsedBody.Code === "AuthorizationPermissionMismatch");
}
}

main();
```

**Error Track:**
The process code for use queue service SAS to create queue in Azurite is shown as following:
[https://github.com/Azure/Azurite/blob/master/src/queue/authentication/QueueSASAuthenticator.ts#L276](https://github.com/Azure/Azurite/blob/master/src/queue/authentication/QueueSASAuthenticator.ts#L276)
![Screenshot 2020-12-15 154859](https://user-images.githubusercontent.com/20970631/102186100-124adf00-3eed-11eb-9381-286e662009cd.png)

Expected Behavior
The error returned in Azurite is consistent with the one in Azure when use queue service SAS to create queue.

@jongio for notification.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.