Azurite doesn't support Set Blob Tier operation on lease blob and snapshot blob.
See original GitHub issueError 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:
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("<container-name>");
const blockBlobClient = await containerClient.getBlockBlobClient("<blob-name>");
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
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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Lease Blob (REST API) - Azure Storage | Microsoft Learn
The Lease Blob operation creates and manages a lock on a blob for write and delete operations.
Read more >azurite - npm
A lightweight server clone of Azure Blob Storage that simulates most of the commands supported by it with minimal dependencies.
Read more >Azure Blob Storage binding spec - Dapr Docs
This is useful when using the Azurite emulator or when using custom domains for Azure Storage (although this is not officially supported). The...
Read more >AzureStor.pdf
Operations on an Azure Data Lake Storage Gen2 endpoint. Description ... A service SAS can be used with blob and file storage,.
Read more >azure.storage.blob package - NET
If the container does not have an active lease, the Blob service creates a ... for the service, then this operation soft deletes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dennisdietrich Thanks for the information! We will priority the fix.
We welcome contribution to Azurite. It would be great if you could contribute the the fix of this issue.
azsdk-azurite