gpt4 book ai didi

azure - 使用 ARM 模板对 Azure 存储帐户容器设置合法保留

转载 作者:行者123 更新时间:2023-12-03 02:29:01 28 4
gpt4 key购买 nike

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

设置不可变 Blob 存储策略时,Azure 门户允许您选择合法保留和时基保留。根据doc arm 模板支持不可变的 blob 存储。但是,仅接受具有 immutabilityPeriodSinceCreationInDays 的请求。当尝试不设置它时,我得到:

Missing at least one of the following properties 'immutabilityPeriodSinceCreationInDays,allowProtectedAppendWrites'

或者:

immutabilityPeriodSinceCreationInDays must be set before setting allowProtectedAppendWrites

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

{"status": "Failed","error": {"code": "UnexpectedException","message": "The server was unable to complete your request."}}

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

最佳答案

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

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

关于azure - 使用 ARM 模板对 Azure 存储帐户容器设置合法保留,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65889886/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com