Azure / Azure/Azurite

Azurite doesn't support Set Blob Tier operation on lease blob and snapshot blob.

Open
#632 6 comments 0 reactions 1 assignee Claimed by @blueww View on GitHub
blob-storage bug NewArch
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

**Error Description:**
In Azure, it will return error "BlobNotFound" when use Set Blob Tier operation with invalid leaseId or snapshot.
But in Azurite, it will set blob tier successfully in this case.
Azure error is shown as following:
![Screenshot 2020-11-23 112344](https://user-images.githubusercontent.com/20970631/99927049-da81c900-2d7e-11eb-998c-79c2327876ea.png)

**To Reproduce**
```
import {
BlobServiceClient
} from "@azure/storage-blob";
import * as assert from "assert"

async function main() {
const blobServiceClient = await BlobServiceClient.fromConnectionString("Azurite-https-connectionString");
const containerClient = await blobServiceClient.getContainerClient("");
const blockBlobClient = await containerClient.getBlockBlobClient("");
const fakeVersion = "2020-04-23T03:21:50.5338150Z";
const snapshotBlobClient = blockBlobClient.withSnapshot(fakeVersion);
try{
await snapshotBlobClient.setAccessTier("Cool");
}catch(err){
console.log(err);
assert.ok((err as any).response.parsedBody.Code === "BlobNotFound");
}
}

main();
```

**Error Track:**
The reason maybe is that the parameter leaseId and snapshot are not be processed in Blob Set Tier handler method in azurite. The code is shown as following:
[https://github.com/Azure/Azurite/blob/master/src/blob/handlers/BlobHandler.ts#L872](https://github.com/Azure/Azurite/blob/master/src/blob/handlers/BlobHandler.ts#L872)
![Screenshot 2020-11-18 160216](https://user-images.githubusercontent.com/20970631/99935802-808ffc00-2d9c-11eb-8be3-57e45f0258c8.png)

**Expected Behavior**
When use Set Blob Tier operation with invalid leaseId or snapshot, it doesn't set blob tier successfully and return the error "BlobNotFound".

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