【发布时间】: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