你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

快速入门:通过 Azure 门户在 Azure Spring Apps 中创建服务连接

本快速入门介绍如何使用 Azure 门户和服务连接器将 Azure Spring Apps 连接到其他云资源。 使用服务连接器可以快速将计算服务连接到云服务,同时管理连接身份验证和网络设置。

注意

有关使用 Azure CLI 连接资源的信息,请参阅使用 Azure CLI 在 Azure Spring Apps 中创建服务连接

先决条件

登录 Azure

使用 Azure 帐户登录到 https://portal.azure.com/ 的 Azure 门户。

创建新的服务连接

你将在 Azure Spring Apps 中使用服务连接器创建新的服务连接。

  1. 若要在 Azure Spring Apps 中创建新的连接,请选择 Azure 门户顶部的“搜索资源、服务和文档(G +/)”搜索栏,在筛选器中键入“Azure Spring Apps”,然后选择“Azure Spring Apps”。

    Screenshot of the Azure portal, selecting Azure Spring Apps.

  2. 选择要连接到目标资源的 Azure Spring Apps 实例的名称。

  3. 在“设置”下,选择“应用”,然后从列表中选择应用程序。

    Screenshot of the Azure portal, selecting an app.

  4. 从左侧目录中,选择“服务连接器”,然后选择“创建”。 Screenshot of the Azure portal, selecting the button to create a connection.

  5. 选择或输入以下设置。

    设置 示例 说明
    服务类型 存储 - Blob 要连接到应用的服务类型。
    连接名称 storageblob_17d38 用于标识应用与目标服务之间的连接的连接名称。 使用服务连接器提供的连接名称或输入自己的连接名称。
    订阅 my-subscription 包含目标服务(要连接到的服务)的订阅。 默认值是包含部署到 Azure Spring Apps 的应用的订阅。
    存储帐户 my-storage-account 要连接到的目标存储帐户。 如果选择其他服务类型,请选择相应的目标服务实例。
    客户端类型 SpringBoot 与所选目标服务配合工作的应用程序堆栈。 除 SpringBoot 和 Java 外,还支持其他堆栈。
  6. 选择“下一步: 身份验证”,以选择身份验证类型。 然后选择“连接字符串”,以使用访问密钥连接存储帐户。 Screenshot of the Azure portal, filling out the Authentication tab.

  7. 选择“下一步: 网络”以选择网络配置,然后选择“配置防火墙规则以启用对目标服务的访问权限”,以便应用可以访问 Blob 存储。

    Screenshot of the Azure portal, filling out the Networking tab.

  8. 选择“下一步: 查看 + 创建”,以查看提供的信息。 等待几秒钟,让服务连接器验证信息,然后选择“创建”以创建服务连接。

查看服务连接

Azure Spring Apps 连接显示在“设置”>“服务连接器”下。

  1. 选择 > 展开列表并访问应用程序所需的属性。

  2. 选择“验证”以检查连接状态,然后选择“了解详细信息”以查看连接验证详细信息。

    Screenshot of the Azure portal, get connection validation result.

后续步骤

有关服务连接器和 Azure Spring Apps 的详细信息,请参阅以下指南: