【问题标题】:Set legal hold on Azure storage account container with ARM template使用 ARM 模板对 Azure 存储帐户容器设置合法保留
【发布时间】:2021-01-25 17:51:20
【问题描述】:

如何在 ARM 模板中设置 Azure 存储帐户容器的合法保留?

在设置不可变 Blob 存储策略时,Azure 门户允许您从法定保留和时基保留中进行选择。根据docarm 模板支持不可变 blob 存储。但是,只接受具有 immutabilityPeriodSinceCreationInDays 的请求。尝试不设置时,我得到:

至少缺少以下属性之一“immutabilityPeriodSinceCreationInDays,allowProtectedAppendWrites”

或者:

immutabilityPeriodSinceCreationInDays 必须在设置 allowProtectedAppendWrites 之前设置

最奇怪的 - 在 immutabilityPolicies 中没有属性块(如下所示)请求失败并出现 InternalServerError:

{ “状态”:“失败”, “错误”: { “代码”:“意外异常”, "message": "服务器无法完成您的请求。" } }

{
  "name": "testsa/default/testcontainer/default",
  "type": "Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies",
  "apiVersion": "2019-06-01"
  // ,
  // "properties": {
  //   // "immutabilityPeriodSinceCreationInDays" : 10,
  //   // "allowProtectedAppendWrites": false
  // }
}

【问题讨论】:

  • 不完全回答您的问题,但在处理存储帐户不变性时,apiVersion 2019-xx-xx 对我不起作用。我必须使用 apiVersion 2021-xx-xx 例如2021-06-01。希望这对其他人有帮助

标签: azure azure-blob-storage azure-resource-manager


【解决方案1】:

根据我的研究,资源类型Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies 可用于创建基于时间的保留策略。同时,在创建基于时间的保留策略时,需要参数immutabilityPeriodSinceCreationInDays。更多详情请参考herehere

此外,目前,Azure ARM 模板不提供任何资源类型来创建设置的合法保留策略。更多详情请参考herehere。所以我建议你在模板中使用deployment scripts 来实现tit。

【讨论】:

    猜你喜欢
    • 2018-02-09
    • 1970-01-01
    • 2020-09-15
    • 1970-01-01
    • 1970-01-01
    • 2021-10-17
    • 2021-03-12
    • 2021-04-24
    • 2017-01-02
    相关资源
    最近更新 更多