Azure / Azure/Azurite

The error returned in azurite is inconsistent with the one in azure cloud when use blob service SAS to create container

Open
#637 3 comments 0 reactions 1 assignee Claimed by @blueww View on GitHub
alignment blob-storage NewArch 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 cloud when use blob service SAS to create container
In azure, the error is shown as following:
![Screenshot 2020-11-19 185908](https://user-images.githubusercontent.com/20970631/99657847-a5812800-2a99-11eb-9215-d7edaaa598a7.png)
In azurite, the error is shown as following:
![Screenshot 2020-11-19 190610](https://user-images.githubusercontent.com/20970631/99658875-078e5d00-2a9b-11eb-850d-be89eaccd00f.png)

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

async function main() {
var containerClient= new ContainerClient("https://storagetestjackson.blob.core.windows.net/test-container-e5e6ba7e-386f-4af1-ad63-7bd219ed9f96?sv=2020-02-10&st=2020-11-19T09%3A57%3A08Z&se=2020-11-19T11%3A57%3A08Z&sr=c&sp=racwdl&sig=eyyAmy7m2PudbDRTLIJiESBmc2F8oJEXHI1zy2Kd%2BL8%3D");
try{
await containerClient.create();
}catch(err){
console.log(err);
assert.ok((err as any).response.parsedBody.Code === "AuthorizationFailure");
}
containerClient = new ContainerClient("https://127.0.0.1:10000/devstoreaccount1/test-container-bb5647c7-ae6d-484a-8fd4-a109253dd21a?sv=2020-02-10&st=2020-11-19T10%3A04%3A27Z&se=2020-11-19T12%3A04%3A27Z&sr=c&sp=racwdl&sig=MhbckIFoH%2BaZVHQTlyeQZdl%2FIsadINWHaZ7dFJxilCQ%3D");
try{
await containerClient.create();
}catch(err){
console.log(err);
assert.ok((err as any).response.parsedBody.Code === "AuthorizationPermissionMismatch");
}
}

main();
```

**Error Track:**
The process code for use blob service SAS to create container in Azurite is shown as following:
[https://github.com/Azure/Azurite/blob/master/src/blob/authentication/BlobSASAuthenticator.ts#L304](https://github.com/Azure/Azurite/blob/master/src/blob/authentication/BlobSASAuthenticator.ts#L304)
![Screenshot 2020-11-18 194316](https://user-images.githubusercontent.com/20970631/99526534-57efb700-29d6-11eb-826f-dcb243ed2c55.png)

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

@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.