具有自定义vnet手臂模板的Azure Databricks将无法连接到自定义vnet

时间:2019-06-03 13:02:28

标签: azure powershell databricks arm-template azure-databricks

使用以下ARM模板,我使用自定义的托管资源组名称部署Azure Databricks,并将工作线程添加到自定义的VNET。在门户网站中,这可以正常工作。但是,当我尝试在ARM模板中执行此操作时,托管资源组会继续为工作人员部署工作人员vnet。我以为自己在正确的轨道上,但是缺少一种设置。但是无法弄清楚。有谁能看到我所缺少的东西?

源ARM:https://github.com/Azure/azure-quickstart-templates/tree/master/101-databricks-workspace-with-vnet-injection

{
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "databricksName": {
            "type": "string",
            "metadata": {
                "description": "The name of the databricks workspace"
            }
        },
        "pricingTier": {
            "type": "string",
            "allowedValues": [
                "trial",
                "standard",
                "premium"
            ],
            "metadata": {
                "description": "The pricing tier of workspace."
            }
        },
        "managedResourceGroupName": {
            "type": "string",
            "metadata": {
                "description": "The name of the managed resource group that databricks will create"
            }
        },
        "Location": {
            "type": "string",
            "defaultValue": "[resourceGroup().location]",
            "metadata": {
                "description": "The Location of the deployment"
            }
        },
        "vnetName": {
            "type": "string",
            "metadata": {
                "description": "The Name of the virtual network where the Workers would be connected to"
            }
        },
        "privateSubnetName": {
            "defaultValue": "public-subnet",
            "type": "string",
            "metadata": {
                "description": "The name of the private subnet to create."
            }
        },
        "publicSubnetName": {
            "defaultValue": "private-subnet",
            "type": "string",
            "metadata": {
                "description": "The name of the public subnet to create."
            }
        }
    },
    "variables": {
        "ManagedResourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('managedResourceGroupName'))]",
        "vnetId": "[resourceId('Microsoft.Network/virtualNetworks', parameters('vnetName'))]"
    },
    "resources": [
        {
            "name": "[parameters('databricksName')]",
            "type": "Microsoft.Databricks/workspaces",
            "apiVersion": "2018-04-01",
            "tags": {
                "description": "MIG6 databricks workspace",
                "costCenter": "WPIPM12SG552"
            },
            "location": "[parameters('Location')]",
            "properties": {
                "managedResourceGroupId": "[variables('managedResourceGroupId')]",
                "parameters": {
                    "customVirtualNetworkId": {
                        "value": "[variables('vnetId')]"
                    },
                    "customPublicSubnetName": {
                        "value": "[parameters('publicSubnetName')]"
                    },
                    "customPrivateSubnetName": {
                        "value": "[parameters('privateSubnetName')]"
                    }
                }
            },
            "sku": {
                "name": "[parameters('pricingTier')]"
            }
        }
    ]
}

1 个答案:

答案 0 :(得分:1)

您需要将vnet嵌套在模板中,这对我有用:

return new ListCell<String>() {

    @Override
    protected void updateItem(String item, boolean empty) {
        super.updateItem(item, empty);
        setText(item);
        if (item != null) {
            setStyle(item.equals("complete") ? "-fx-text-fill: red" : "-fx-text-fill: black");
        }
    }
};