在手臂模板中的Datalake存储上启用虚拟网络规则

时间:2018-11-28 11:34:04

标签: azure azure-data-lake azure-virtual-network arm-template

我正在尝试为Datalake存储启用虚拟网络规则。这是我的手臂模板:

{
  "name": "datalakestoretest",
  "type": "Microsoft.DataLakeStore/accounts",
  "location": "[resourceGroup().location]",
  "apiVersion": "2016-11-01",
  "properties": {
    "virtualNetworkRules": [
      {
        "properties": {
          "subnetId": "[variables('subnetId')]"
        },
        "name": "vnetrulename"
      }
    ]
  },
  "dependsOn": [
    "[ concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]"
  ]
}

部署模板时,它不会启用vNet规则。

enter image description here

但是,当我在门户中添加规则时,它的配置已经存在,而无需选择vNet和子网。

enter image description here

因此datalake存储正在从模板接收vNet规则,但只是未启用它。如何启用它?

我还尝试了the msft documentation,中的语法,因此vNetRule作为单独的资源,但是无法部署。

谢谢

1 个答案:

答案 0 :(得分:1)

您需要将"firewallState": "Enabled",添加到模板中的资源属性:

{
    "properties": {
        "firewallState": "Enabled",
        "virtualNetworkRules": [
            {
                "properties": {
                    "subnetId": "xxx"
                },
                "name": "xxx"
            }
        ]
    },
    "apiVersion": "2016-11-01",
    "location": "yyy",
    "name": "xxx",
    "type": "Microsoft.DataLakeStore/accounts"
}
相关问题