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

Azure API for FHIR 的客户端应用程序注册

重要

Azure API for FHIR 将于 2026 年 9 月 30 日停用。 按照迁移策略,按该日期过渡到 Azure Health Data Services FHIR 服务。 由于 Azure Health Data Services FHIR 停用,在 2025 年 4 月 1 日开始前不会允许新的部署。 Azure Health Data Services FHIR 服务 是 Azure API for FHIR 的不断发展版本,可让客户通过集成到其他 Azure 服务来管理 FHIR、DICOM 和 MedTech 服务。

在上一篇教程中,你已部署并设置了 Azure API for FHIR。 设置 Azure API for FHIR 后,我们将注册一个公共客户端应用程序。 可以通读完整的 注册公共客户端应用 操作指南,了解更多详细信息或故障排除,但本文中介绍了本教程的主要步骤。

  1. 导航到 Microsoft Entra ID

  2. 选择“应用注册” -->“新建注册”

  3. 命名应用程序

  4. 选择“公共客户端/本机(移动和桌面)”,然后将重定向 URI 设置为 https://www.getpostman.com/oauth2/callback

    Screenshot of the Register an application pane, and an example application name and redirect URL.

客户端应用程序设置

注册客户端应用程序后,从“概述”页中复制应用程序(客户端)ID 和租户 ID。 稍后访问客户端时需要这两个值。

Screenshot of the client application settings pane, with the application and directory IDs highlighted.

与 Web 应用连接

如果已 编写 Web 应用 以连接到 Azure API for FHIR,则还需要设置正确的身份验证选项。

  1. 在左侧菜单中的“管理”下,选择“身份验证” 。

  2. 若要添加新的平台配置,请选择“Web”

  3. 设置重定向 URI,为在本教程的第四部分中创建 Web 应用程序做好准备。 要执行此操作,请将 https://\<WEB-APP-NAME>.azurewebsites.net 添加到重定向 URI 列表。 如果在编写 Web 应用的步骤中选择了其他名称,则需要返回并更新此名称。

  4. 选择“访问令牌”和“ID 令牌”复选框

    Screenshot of the app Authentication settings blade, with the steps to add a platform highlighted.

添加 API 权限

设置正确的身份验证后,请设置 API 权限:

  1. 选择 API 权限 ,然后选择“ 添加权限”。
  2. 在我的组织使用的 API 下,搜索 Azure Health Data Services。
  3. 选择 user_impersonation 并选择 “添加权限”。

Screenshot of the Add API permissions blade, with the steps to add API permissions highlighted.

后续步骤

你现在已拥有了一个公用客户端应用程序。 在下一教程中,我们将演练测试并通过 Postman 访问此应用程序。

FHIR® 是 HL7 的注册商标,经 HL7 许可使用。