c# - azure 中何时创建了 block blob?

标签 c# azure azure-blob-storage

blob 引用包含一个 Properties 属性,该属性的 LastModifiedDateTimeOffset?。但是,我找不到 blob 的创建日期(时间)。是否有我可以使用的标准 API 或者我需要将其存储在元数据中?

    public async Task<IBlobMeta> GetBlobMetaAsync(string blobId)
        {
            if (IsNullOrWhiteSpace(blobId))
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(blobId));

            var blob = await EnsureGetBlobById(blobId);
            await blob.FetchAttributesAsync();

            string clientBlobName;
            blob.Metadata.TryGetValue(BlobNameMetaKey, out clientBlobName);

            var length = blob.Properties.Length;
            var md5 = blob.Properties.ContentMD5;
            var lastModified = blob.Properties.LastModified.Value.ToUniversalTime().DateTime;
            var dateCreated= blob.Properties.???????;
            return new AzureBlobMeta(blobId, clientBlobName, length, md5, dateCreated);
  }

最佳答案

Is there a standard API I can use or I need to store that in the meta?

从今天开始,您需要以 blob 元数据的形式存储此信息。没有 API 可以告诉您 blob 何时创建。 Blob 的 Last Modified 属性告诉您 Blob 的最后修改时间。这可能是因为 blob 的内容已更改,或其属性或元数据已更改。

关于c# - azure 中何时创建了 block blob?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41287749/

相关文章:

azure - 如何使用Azure应用程序服务自动缩放处理内存缓存

node.js - 如何从私有(private) Azure Blob 存储容器中删除 Blob

c# - 如何将 IdentityRole 扩展为自定义表名

c# - 如何在 linq 的 select 语句中使用 where 子句。 (即在属性(property)上。)

c# - 调用包含来自 MVC Controller 的异步调用的服务的正确模式

c# - 将 azure 数据库连接到现有的 xamarin 项目

c# - Azure Functions 使用带有 Http 触发器的取消 token

c# - 在代码隐藏中设置其 url 时无法呈现图像

c# - 从 Azure Blob 获取修改的最新文件

javascript - 使用纯 JavaScript 和 Azure-Storage-Js 下载 Azure 存储 Blob