Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.83k stars 325 forks source link

The value of property accessTierChangeTime is set when upload blob on block blob in Azurite #820

Open zzhxiaofeng opened 3 years ago

zzhxiaofeng commented 3 years ago

Error Description: In Azure, property accessTierChangeTime is null when upload blob on block blob. But in Azurite, property accessTierChangeTime has a value in this case.

To Reproduce: Please run the demo code as following:

import { BlobServiceClient, StorageSharedKeyCredential } from "@azure/storage-blob";
import { assert } from "chai";

async function main() {
    const blobServiceClient = new BlobServiceClient("<Azurite-https-endpoint>", new StorageSharedKeyCredential("<account-name>", "<account-key>"));
    const containerClient = blobServiceClient.getContainerClient("<container-name>");
    await containerClient.create();
    const blockBlobClient = containerClient.getBlockBlobClient("<blob-name>");
    const content = "Hello World";
    await blockBlobClient.upload(content, content.length);

    const properties = await blockBlobClient.getProperties();
    assert.ok(!properties.accessTierChangedOn);
}

main();

Error Track: https://github.com/Azure/Azurite/blob/master/src/blob/handlers/BlockBlobHandler.ts#L119 Screenshot 2021-06-08 163234 In Azurite, the value of property accessTierChangeTime is set when upload blob on block blob.

Expected Behavior: In Azurite, property accessTierChangeTime is null when upload blob on block blob.

@jongio for notification.

blueww commented 3 years ago

@zzhxiaofeng

Thanks for raising this issue! We will look at it.

Azurite welcome contribution. It would be great if you can raise a PR to fix it.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.