azure - 通过托管标识将 Azure WebApp 限制为 APIM?

标签 azure azure-active-directory azure-web-app-service azure-api-management

我想知道是否可以通过托管身份限制对 Azure Web 应用程序(它作为 API 运行,因此我不希望仅通过 URL 进行公共(public)访问)对 API Manager 的访问?我看到的所有内容都是使用 Azure HTTP Functions,而不是 Web 应用程序 我假设这样做的话 AD 中的用户也可以直接访问网络应用程序?

最佳答案

是的,这是可能的。 您的后端 API 需要检查:

  • 在 API 应用注册中定义并通过 PowerShell 分配给托管身份的应用程序权限 (appRole)
  • 或者检查 token 中的对象 ID 是否与托管身份匹配

在第一个选项中,其他应用程序将无法直接使用 API,除非应用程序管理员/全局管理员向该客户端应用程序授予该权限。 第二个选项完全阻止其他应用程序直接使用 API。 在这两种情况下,您都会有 the API Management policy获取针对您的 API 应用注册的访问 token 。

关于azure - 通过托管标识将 Azure WebApp 限制为 APIM?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72098279/

相关文章:

database - 使用API​​获取azure数据库的组件层详细信息

python - 通过 Python Web API 进行 Azure AD 身份验证

azure - Azure Web 应用程序请求的资源中不存在 'Access-Control-Allow-Origin' header

powershell - 将 Azure AD 用户添加到 Azure AD 组

asp.net-web-api - EF 核心 : An exception occurred in the database while iterating the results of a query

azure - Terraform:如何检索 aks 托管的出站 IP

android - Azure mobileserviceclient 登录返回身份验证错误 (401)

Azure Web 服务和 "Add Identity Provider": Create new app registration is disabled

java - 上传到 Azure 时无法访问 RESTful 端点

azure - 如何从 Visual Studio 禁用应用程序服务的手动部署