您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

快速入门:在 Synapse 中创建新的 Azure 机器学习链接服务Quickstart: Create a new Azure Machine Learning linked service in Synapse

在本快速入门中,你需要将 Azure Synapse Analytics 工作区链接到 Azure 机器学习工作区。In this quickstart, you'll link an Azure Synapse Analytics workspace to an Azure Machine Learning workspace. 通过链接这些工作区,可以利用 Synapse 中的各种体验来使用 Azure 机器学习。Linking these workspaces allows you to leverage Azure Machine Learning from various experiences in Synapse.

例如,链接到 Azure 机器学习工作区可获得以下体验:For example, this linking to an Azure Machine Learning workspace enables these experiences:

先决条件Prerequisites

  • Azure 订阅 - 免费创建订阅Azure subscription - Create one for free.
  • Synapse Analytics 工作区,其中 ADLS Gen2 存储帐户配置为默认存储。Synapse Analytics workspace with an ADLS Gen2 storage account configured as the default storage. 你必须是所用 ADLS Gen2 文件系统的存储 Blob 数据参与者。You need to be the Storage Blob Data Contributor of the ADLS Gen2 filesystem that you work with.
  • Azure 机器学习工作区Azure Machine Learning Workspace.
  • 你需要具有相应权限(或者由具有相应权限的人请求)来创建服务主体和密码,它们可用于创建链接服务。You need permissions (or request from someone who has permissions) to create a service principal and secret which you can use to create the linked service. 请注意,需要为此服务主体分配 Azure 机器学习工作区中的参与者角色。Note that this service principal needs to be assigned the contributor role in the Azure Machine Learning Workspace.

登录到 Azure 门户Sign in to the Azure portal

登录到 Azure 门户Sign in to the Azure portal

创建服务主体Create a service principal

此步骤将创建新的服务主体。This step will create a new Service Principal. 如果要使用现有服务主体,则可以跳过此步骤。If you want to use an existing Service Principal, you can skip this step.

  1. 打开 Azure 门户。Open Azure portal.

  2. 转到“Azure Active Directory” -> “应用注册”。 Go to Azure Active Directory -> App registrations.

  3. 单击“新建注册”。Click New registration. 然后,按照 UI 上的说明注册新的应用程序。Then, follow instructions on the UI to register a new application.

  4. 注册应用程序后,After the application is registered. 为它生成一个密码。Generate a secret for the application. 转到你的应用程序 -> “证书和密码”。Go to Your application -> Certificate & Secret. 单击“添加客户端密码”以生成密码。Click Add client secret to generate a secret. 请妥善保管密码,稍后将用到它。Keep the secret safe and it will be used later.

    生成密码

  5. 为应用程序创建服务主体。Create a service principal for the application. 转到你的应用程序 -> “概述”,然后单击“创建服务主体”。Go to Your application -> Overview and then click Create service principal. 在某些情况下,系统会自动创建此服务主体。In some cases, this service principal is automatically created.

    创建服务主体

  6. 将服务主体添加为 Azure 机器学习工作区的“参与者”。Add the service principal as "contributor" of the Azure Machine Learning workspace. 请注意,必须是 Azure 机器学习工作区所属资源组的所有者才能执行此操作。Note that this will require being an owner of the resource group that the Azure Machine Learning workspace belongs to.

    分配参与者角色

创建链接服务Create a linked service

  1. 在要新建 Azure 机器学习链接服务的 Synapse 工作区中,转到“管理” -> “链接服务”,创建一个类型为“Azure 机器学习”的新链接服务。In the Synapse workspace where you want to create the new Azure Machine Learning linked service, go to Management -> Linked service, create a new linked service with type "Azure Machine Learning".

    创建链接服务

  2. 填写表单:Fill out the form:

    • 服务主体 ID:这是应用程序的应用程序(客户端)ID。Service principal ID: This is the application (client) ID of the Application.

      备注

      这不是应用程序的名称。This is NOT the name of the application. 你可以在应用程序的概述页中找到此 ID。You can find this ID in the overview page of the application. 它应是一个类似于“81707eac-ab38-406u-8f6c-10ce76a568d5”的长字符串。It should be a long string looking similar to this "81707eac-ab38-406u-8f6c-10ce76a568d5".

    • 服务主体密钥:在上一部分中生成的密钥。Service principal key: The secret you generated in the previous section.

  3. 单击“测试连接”以验证配置是否正确。Click Test Connection to verify if the configuration is correct. 如果连接测试通过,请单击“保存”。If the connection test passes, click Save.

    如果连接测试失败,请确保服务主体 ID 和密码正确无误,然后重试。If the connection test failed, make sure that the service principal ID and secret are correct and try again.

后续步骤Next steps