具有Key Vault证书的ARM模板 [英] ARM Template with Key Vault certificate

查看:69
本文介绍了具有Key Vault证书的ARM模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到一个奇怪的问题.我有1个ARM模板,可用于部署2个环境.

I am having a strange issue. I have 1 ARM template, which I use to deploy 2 environments.

我要添加这样的证书:

{
        "type": "Microsoft.Web/certificates",
        "name": "[variables('certificateName')]",
        "apiVersion": "2016-03-01",
        "location": "[resourceGroup().location]",
        "properties": {
            "keyVaultId": "[parameters('almKeyVaultId')]",
            "keyVaultSecretName": "[parameters('servicePrincipalCertSecretName')]",
            "serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
        },
        "dependsOn": [
            "[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
        ]
    },

对于我的测试环境,此操作成功.部署质量检查环境时,出现错误:参数KeyVaultId&KeyVaultSecretName的值无效.

For my test environment, this succeeds. When I deploy my QA environment, I got the error: The parameter KeyVaultId & KeyVaultSecretName has an invalid value.

但是,测试"和质量检查"的参数值相同(almKeyVaultId和servicePrincipalCertSecretName).

However, the parameter values for Test and QA are identically (almKeyVaultId & servicePrincipalCertSecretName).

有任何想法我在做什么错吗?

Any ideas what I am doing wrong?

更新

删除完整的QA资源组后,我能够重新部署完全相同的ARM模板.似乎应该在Key Vault机密之后创建资源组?有什么想法吗?如果我们在生产中遇到这种情况,我们不想删除整个资源组

After deleting the full QA resource group, I was able to redeploy the exact same ARM template. It seems that the resource group should be created after the Key Vault secret? Any ideas why? If we would encounter this in production, we don't want to delete the full resource group

推荐答案

我认为我已经找到了造成此问题的原因.显然,创建资源组后,您将无法更改秘密名称.如果这样做,将引发上面的错误.

I think I found the cause of this issue. Apparently, when a resource group has been created, you cannot change the secret name. If you do so, the error above will be thrown.

如果要更改秘密名称,则需要删除资源组并重新部署所有内容.

If you want to change the secret name, you need to delete the resource group and redeploy everything.

这篇关于具有Key Vault证书的ARM模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆