本文介绍了对于具有托管身份的Azure应用服务,如何检索客户端ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取系统分配的身份的Azure Web App(通常是App Service)的客户端ID?在身份刀片中,我仅看到对象ID.

How can I retrieve the client id of an Azure Web App (or App Service, generally) for a system-assigned identity? In the identity blade, I only see object id.

我需要使用它来启用AAD服务以进行服务访问,并且正在调用的服务将使用从其发送的令牌中提取的客户ID授权我的请求.但是,我不知道如何找到我的客户ID.

I need this to enable AAD service to service access, and the service I am calling will authorize my request using my client id that it extracts from the token I send it. However, I don't know how to find my client id.

推荐答案

当为您的App Service Web应用程序启用系统分配的托管服务身份时,它将创建一个服务主体(在Azure门户的企业应用程序下可见).

When you enable System Assigned Managed Service Identity for your App Service web app, it creates a Service Principal (visible under Enterprise applications in Azure Portal).

即使您只能在App Service的身份刀片中看到对象ID",也可以通过转到 Azure门户找到更多详细信息,包括应用ID(或您要求的客户端ID). > Azure Active Directory > 企业应用程序> 所有应用程序> 相关服务主体(您可以使用显示名称来确定与您的网络应用或对象ID相同).更详细的步骤以及下面的屏幕截图.

Even though you can only see the Object ID in Identity blade for App Service, but you can find a few more details including Application ID (or Client ID as you ask) by going to Azure Portal > Azure Active Directory > Enterprise Applications > All Applications > Relevant Service Principal (you can figure out using display name which is same as your web app or the Object ID). More detailed steps along with screenshots below.

请注意,即使您可以获取应用程序ID"和MSI的一些详细信息,也不会为它找到实际的应用程序注册.

Please note that even though you can get to Application ID and some details for MSI, you will not find an actual app registration for it.

  • 例如,我有一个名为"RohitMSIWebApp1"的应用服务,如下所示

  • For example, I have an App Service named "RohitMSIWebApp1" as shown here

转到Azure门户> Azure Active Directory>企业应用程序>所有应用程序

Go to Azure Portal > Azure Active Directory > Enterprise Applications > All Applications

在搜索框中输入您的Web应用的显示名称,以将其过滤为相关的服务主体

Enter the display name of your web app in search box, to filter it to the relevant service principal

转到Service Principal的属性以获取更多详细信息

Go to the properties of Service Principal for more details

这篇关于对于具有托管身份的Azure应用服务,如何检索客户端ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 12:04