Nota
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
本文介绍了如何使用 ARM 模板创建 Azure Databricks 工作区。
ARM 模板是定义项目基础结构和配置的 JavaScript 对象表示法 (JSON) 文件。 该模板使用声明性语法,使你可以声明要部署的内容,而不需要编写一系列编程命令来进行创建。
如果你的环境满足先决条件,并且你熟悉如何使用 ARM 模板,请选择“部署到 Azure”按钮。 Azure 门户中会打开模板。
查看模板
本快速入门中使用的模板来自 Azure 快速启动模板。
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.5.6.12127",
"templateHash": "14509124136721506545"
}
},
"parameters": {
"disablePublicIp": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Specifies whether to deploy Azure Databricks workspace with Secure Cluster Connectivity (No Public IP) enabled or not"
}
},
"workspaceName": {
"type": "string",
"metadata": {
"description": "The name of the Azure Databricks workspace to create."
}
},
"pricingTier": {
"type": "string",
"defaultValue": "premium",
"allowedValues": ["standard", "premium"],
"metadata": {
"description": "The pricing tier of workspace."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
}
},
"variables": {
"managedResourceGroupName": "[format('databricks-rg-{0}-{1}', parameters('workspaceName'), uniqueString(parameters('workspaceName'), resourceGroup().id))]"
},
"resources": [
{
"type": "Microsoft.Databricks/workspaces",
"apiVersion": "2018-04-01",
"name": "[parameters('workspaceName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('pricingTier')]"
},
"properties": {
"managedResourceGroupId": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('managedResourceGroupName'))]",
"parameters": {
"enableNoPublicIp": {
"value": "[parameters('disablePublicIp')]"
}
}
}
}
],
"outputs": {
"workspace": {
"type": "object",
"value": "[reference(resourceId('Microsoft.Databricks/workspaces', parameters('workspaceName')))]"
}
}
}
模板中定义的 Azure 资源是 Microsoft.Databricks/workspaces:创建 Azure Databricks 工作区。
部署模板
在本部分,你将使用 ARM 模板创建 Azure Databricks 工作区。
使用提供的链接登录到 Azure 并打开一个模板。
提供所需的以下值以创建 Azure Databricks 工作区:
Property 说明 订阅 从下拉列表中选择自己的 Azure 订阅。 资源组 指定是要创建新的资源组还是使用现有的资源组。 资源组是用于保存 Azure 解决方案相关资源的容器。 有关详细信息,请参阅 Azure 资源组概述。 位置 选择“中国东部 2”。 有关其他可用区域,请参阅各区域推出的 Azure 服务。 工作区名称 提供 Databricks 工作区的名称 定价层 选择“标准”或“高级”。 有关这些层的详细信息,请参阅 Databricks 价格页。 选择“查看 + 创建”,然后选择“创建” 。
创建工作区需要几分钟时间。 当工作区部署失败时,仍然会在失败状态下创建工作区。 删除失败的工作区,并创建一个解决部署错误的新工作区。 删除失败的工作区时,托管资源组和任何成功部署的资源也将被删除。
查看已部署的资源
可以使用 Azure 门户检查 Azure Databricks 工作区,或者使用以下 Azure CLI 或 Azure PowerShell 脚本来列出资源。
Azure CLI
echo "Enter your Azure Databricks workspace name:" &&
read databricksWorkspaceName &&
echo "Enter the resource group where the Azure Databricks workspace exists:" &&
read resourcegroupName &&
az databricks workspace show -g $resourcegroupName -n $databricksWorkspaceName
Azure PowerShell
$resourceGroupName = Read-Host -Prompt "Enter the resource group name where your Azure Databricks workspace exists"
(Get-AzResource -ResourceType "Microsoft.Databricks/workspaces" -ResourceGroupName $resourceGroupName).Name
Write-Host "Press [ENTER] to continue..."