首页 > 解决方案 > How to call an Azure Rest API from an Azure Web Application

问题描述

I was wondering if I can get some direction on this problem. I have an Azure Rest API that I only want a few of my Azure Web Apps access to. I thought if I deny anonymous on the Rest API and set up the Web Apps' service principals in AAD I would be able to achieve this. Most of the examples I seen require the user of the Web App to login which is not a requirement for what I am doing. Essentially the Web Apps are the only consumers and I know their Service Principal information but I can't figure the next step. Thanks

标签: azurerestasp.net-web-apiservice-principal

解决方案


一种可能的解决方案是使用Managed Service Identity. 本质上,您将为您的 WebApps 分配一个身份,然后只允许从这些身份访问 API。

您可以在此处找到有关托管服务标识的更多信息:https ://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview和https://docs.microsoft.com /en-us/azure/app-service/overview-managed-identity?tabs=dotnet


推荐阅读