gpt4 book ai didi

azure - 在 Azure KeyVault 的 ARM 模板中添加 virtualNetworkRules

转载 作者:行者123 更新时间:2023-12-02 23:18:03 25 4
gpt4 key购买 nike

我想在 ARM 模板中添加 virtualNetworkRules。但不幸的是,它无法获取参数并激活防火墙和虚拟网络设置。

我使用下面的脚本创建一个 ARM 模板: https://learn.microsoft.com/en-us/azure/templates/microsoft.keyvault/2018-02-14/vaults#IPRule

    {
"type": "Microsoft.KeyVault/vaults",
"name": "[parameters('keyVaultName')]",
"apiVersion": "2018-02-14",
"location": "[parameters('location')]",
"properties": {
"firewallState": "Enabled",
"enabledForDeployment": "[parameters('enabledForDeployment')]",
"enabledForDiskEncryption": "[parameters('enabledForDiskEncryption')]",
"enabledForTemplateDeployment": "[parameters('enabledForTemplateDeployment')]",
"tenantId": "[parameters('tenantId')]",
"accessPolicies": [
{
"objectId": "[parameters('objectId')]",
"tenantId": "[parameters('tenantId')]",
"permissions": {
"keys": "[parameters('keysPermissions')]",
"secrets": "[parameters('secretsPermissions')]"
}
}
],
"sku": {
"name": "[parameters('skuName')]",
"family": "A"
},
"networkAcls": {
"bypass": "AzureServices",
"ipRules": [
{
"value": "xxxx"
}
],
"virtualNetworkRules": [
{
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnet1Name'))]"
}
]
}
}
}
]

ARM 脚本中的networkAcls 部分根本不起作用。它不会激活防火墙和虚拟网络设置。

最佳答案

问题是由于缺少其中一个属性,在添加它后它起作用了:

        "networkAcls": {
"bypass": "AzureServices",
"defaultAction": "Deny"
"ipRules": [
{
"value": "xxxx"
}
],
"virtualNetworkRules": [
{
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnet1Name'))]"
}
]
}

关于azure - 在 Azure KeyVault 的 ARM 模板中添加 virtualNetworkRules,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56478089/

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