服务负责人分配给谁? ACT 还是应用服务?

Service principle assign to who? ACR or App service?

我有一个 azure 应用程序服务,它从 azure ACR 中提取图像并将图像启动到 运行 应用程序。

我想要应用程序服务从 ACR 中根据服务原则拉取图像的操作。我的问题是我应该将服务主体分配给哪个资源? ACR 还是网络服务?

在应用服务上使用托管标识为后端的应用服务提供服务主体。然后,您可以使用 RBAC 允许应用服务计划标识访问 ACR。

This shows how to do it with a VM 但它适用于任何支持 MI

的 azure 服务

My question is which resource should I assign the service principle to? The ACR or the web service?

简短的回答是 ACR。其实正确的理解是service principal应该有拉取ACR镜像的权限,所以需要把ACR的权限分配给service principal