Azure Blob 存储更改现有容器的加密范围

标签 azure azure-storage azure-blob-storage

我正在尝试更改现有 Azure Blob 存储容器的加密范围。我正在使用 Azure 管理 API 和相关 SDK。当我尝试设置加密范围新容器时,一切正常:

var container = new BlobContainer(name:"testcontainer2", defaultEncryptionScope:"testscope", denyEncryptionScopeOverride: true);
var res = await client.BlobContainers.CreateWithHttpMessagesAsync("cmkpoc", "cmktest", "testcontainer2", container);

这成功创建了新容器,并且我看到在 Azure 门户(容器属性)中分配了自定义加密范围:

enter image description here

不幸的是,当我尝试修改现有容器时,我仍然收到来自 Azure API 的 200 响应,但加密范围没有更改。代码:

var container = new BlobContainer(name:"testcontainer", defaultEncryptionScope:"testscope", denyEncryptionScopeOverride: true);
var res = await client.BlobContainers.UpdateWithHttpMessagesAsync("cmkpoc", "cmktest", "testcontainer", container);

本例中的容器属性:

enter image description here

这让我认为加密范围可能不受支持,但我在存储文档中找不到。

最佳答案

• 当您创建容器时,它会自动选择加密范围,但创建容器后您无法更改加密范围,因为创建时的加密范围已经由加密参数定义,即 Microsoft-托管默认 key 或客户管理 key 。

• 但有一种方法可以在创建容器或 blob 时选择客户管理的 key 加密范围,如下面的屏幕截图所示。

Encryption scope-container

https://learn.microsoft.com/en-us/azure/storage/blobs/encryption-scope-manage?tabs=portal#upload-a-blob-with-an-encryption-scope – 有关更多详细信息,请参阅“上传具有加密范围的 blob”部分 • 此外,如果您创建容器时未选择加密范围,则会将容器配置为默认加密范围“$account-encryption-key”,如下所示。

Default encryption scope

https://learn.microsoft.com/en-us/azure/storage/blobs/encryption-scope-overview#encryption-scopes-for-containers-and-blobs – 有关更多详细信息,请参阅“容器和 blob 的加密范围”部分。

关于Azure Blob 存储更改现有容器的加密范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69057553/

相关文章:

azure - 解密Azure Function App操作 secret

azure - MSDN 订阅到期后 Windows Azure 门户会发生什么情况。

azure - Blob 租赁的重试政策

azure - 可以在服务器端Azure表存储上添加分区键

c# - 从 blobBaseClient.DownloadToAsync 获取 FullContent

azure - 为每个应用程序创建 Azure 存储帐户还是为每个区域创建一个存储更好?

angular - 如何直接从 Angular 应用程序上传Azure Blob存储中的大文件

azure - 使用 SSH 连接 Azure CentOS VM 时,要求其他人无法访问您的私钥文件

azure - Azure 资源管理器相当于 Docker 的 kubernetes

特定文件夹结构中的文件的 Azure 存储