每工作区 URLPer-workspace URLs

2020 年 4 月,Azure Databricks 为每个工作区添加了新的唯一每工作区 URL。In April 2020, Azure Databricks added a new unique per-workspace URL for each workspace. 此每工作区 URL 采用以下格式This per-workspace URL has the format

adb-<workspace-id>.<random-number>.databricks.azure.cn

每工作区 URL 替换已弃用的区域 URL (<region>.databricks.azure.cn) 以访问工作区。The per-workspace URL replaces the deprecated regional URL (<region>.databricks.azure.cn) to access workspaces.

重要

不要使用旧的区域 URL。Avoid using legacy regional URLs. 它们可能不适用于新的工作区、可靠性更低,而且性能比每工作区 URL 的低。They may not work for new workspaces, are less reliable, and exhibit lower performance than per-workspace URLs.

使用每工作区 URL 启动工作区Launch a workspace using the per-workspace URL

在 Azure 门户中,转到工作区的 Azure Databricks 服务资源页面,单击“启动工作区”,或者复制此资源页上显示的每工作区 URL 并将其粘贴到浏览器地址栏。In the Azure portal, go to the Azure Databricks service resource page for your workspace and either click Launch Workspace or copy the per-workspace URL as displayed on the resource page and paste it into your browser address bar.

资源页resource page

使用 Azure API 获取每工作区 URLGet a per-workspace URL using the Azure API

使用 Azure API 工作区 - Get 终结点获取工作区详细信息,包括每工作区 URL。Use the Azure API Workspaces - Get endpoint to get workspace details, including per-workspace URL. 每工作区 URL 在响应对象的 properties.workspaceUrl 字段中返回。The per-workspace URL is returned in the properties.workspaceUrl field in the response object.

迁移脚本以使用每工作区 URLMigrate your scripts to use per-workspace URLs

Azure Databricks 用户通常采用下面两种方式之一编写脚本或其他自动化来引用工作区:Azure Databricks users typically write scripting or other automation that references workspaces in one of two ways:

  • 可在同一区域中创建所有工作区,并在脚本中对旧区域 URL 进行硬编码。You create all workspaces in the same region and hardcode the legacy regional URL in the script.

    由于每个工作区都需要一个 API 令牌,因此你还会有一个令牌列表,它存储在脚本本身或其他数据库中。Because you need an API token for each workspace, you also have a list of tokens either stored in the script itself or in some other database. 如果是这种情况,建议存储 <per-workspace-url, api-token> 对的列表,并删除所有硬编码的区域 URL。If this is the case, we recommend that you store a list of <per-workspace-url, api-token> pairs and remove any hardcoded regional URLs.

  • 可在一个或多个区域中创建工作区,并将 <regional-url, api-token> 对的列表存储在脚本本身或某数据库中。You create workspaces in one or more regions and have a list of <regional-url, api-token> pairs either stored in the script itself or in a database. 如果是这种情况,建议将每工作区 URL 而非区域 URL 存储在列表中。If this is the case, we recommend that you store the per-workspace URL instead of the regional URL in the list.

备注

由于区域 URL 和每工作区 URL 均受支持,因此任何现有自动化(它们使用区域 URL 引用在引入每工作区 URL 之前创建的工作区)都将继续运作。Because both regional URLs and per-workspace URLs are supported, any existing automation that uses regional URLs to reference workspaces that were created before the introduction of per-workspace URLs will continue to work. 尽管 Databricks 建议你更新所有自动化来使用每工作区 URL,但此情况下无需这样做。Although Databricks recommends that you update any automation to use per-workspace URLs, doing so is not required in this case.

查找工作区的旧区域 URLFind the legacy regional URL for a workspace

如果需要查找工作区的旧区域 URL,请在每工作区 URL 上运行 nslookupIf you need to find the legacy regional URL for a workspace, run nslookup on the per-workspace URL.

$ nslookup adb-<workspace-id>.<random-number>.databricks.azure.cn
Server:   192.168.50.1
Address:  192.168.50.1#53

Non-authoritative answer:
adb-<workspace-id>.<random-number>.databricks.azure.cn canonical name = eastus-c3.databricks.azure.cn.
Name: eastus-c3.databricks.azure.cn
Address: 20.42.4.211