通过托管身份将Azure WebApp限制为APIM?

发布于 2025-01-25 22:17:51 字数 141 浏览 5 评论 0原文

我想知道是否可以限制对Azure Web应用程序的访问(它是API的功能,所以我不希望通过the URL通过托管身份来通过URL访问公共访问)?我看到的一切都用于使用Azure HTTP函数,而不是用于Web应用程序 IM假设AD中的用户也可以直接访问Web应用程序?

I am wondering if it is possible to restrict access to an azure web app (it is functioning as an api, so I dont want public access just via the url) to API Manager through managed identity? Everything I can see is for using Azure HTTP Functions, not to a web app
Im assuming by doing so that users in the AD can also access the web app directly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

美人骨 2025-02-01 22:17:51

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

  • API App注册中定义的应用程序许可(apply)并通过PowerShell分配给托管身份
  • ,或者检查令牌中的对象ID是否

在第一个选项中匹配了托管身份,除非应用程序管理员/Global Admin授予该客户端应用程序的权限,否则其他应用程序将无法直接使用API​​。
第二个选项直接阻止其他应用程序直接使用API​​。
在这两种情况下,您都将拥有 API管理策略获得针对API应用程序注册的访问令牌。

Yes, it is possible.
Your back-end API will need to check for either:

  • An application permission (appRole) defined on the API app registration and assigned to the Managed Identity through PowerShell
  • Or check that the object id in the token matches the Managed Identity

In the first option, other apps won't be able to use the API directly unless that permission is granted to that client application by an Application Admin/Global Admin.
The second option outright prevents other apps from using the API directly.
In both cases, you'll have the API Management policy get an access token targeting your API app registration.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文