我正在尝试从 Release Management 部署一个 ARM 模板,其中包含一个“Microsoft.Web/certificates”资源,该资源引用存储在密钥保管库中的证书。当密钥保管库与我要部署到的资源组位于同一订阅中时,这可以正常工作。但是,当密钥保管库存在于不同的订阅中时,我收到以下错误。
资源 Microsoft.Web/certificates '证书名称' 失败并显示消息
{
"Code": "BadRequest",
"Message": "The parameter Properties.KeyVaultId has an invalid value.",
"Target": null,
"Details": [
{
"Message": "The parameter Properties.KeyVaultId has an invalid value."
},
{
"Code": "BadRequest"
},
{
"ErrorEntity": {
"Code": "BadRequest",
"Message": "The parameter Properties.KeyVaultId has an invalid value.",
"ExtendedCode": "51008",
"MessageTemplate": "The parameter {0} has an invalid value.",
"Parameters": [
"Properties.KeyVaultId"
],
"InnerErrors": null
}
}
],
"Innererror": null
}'
证书资源在我的模板中定义如下。
{
"type":"Microsoft.Web/certificates",
"name": "SomeName",
"location": "East US 2",
"apiVersion": "2016-03-01",
"properties": {
"keyVaultId": "/subscriptions/<subscriptionId>/resourceGroups/<vault resource group>/providers/Microsoft.KeyVault/vaults/<vault name>",
"keyVaultSecretName": "SecretName"
}
}
我正在使用 VSTS 中的 Azure 资源组部署任务来部署资源组。该任务配置为使用具有服务主体的终结点,该服务主体在 Azure 中设置了以下权限:
- 包含密钥保管库的资源组上的密钥保管库参与者角色。
- 获取密钥保管库的秘密权限
Microsoft.Azure.WebSites 主体被授予获取密钥保管库机密的权限。
密钥保管库还启用了“启用对 Azure 资源管理器的访问以进行模板部署”选项。证书是使用 powershell 上传到密钥保管库的,而不是通过门户。
我在这里错过了什么吗?
谢谢