首页 > 解决方案 > 如何使用 Azure Powershell 检索应用系统分配的标识对象 ID

问题描述

我正在使用 Azure Powershell 3.8.0

我正在尝试获取可以在此屏幕中看到的对象 ID:

身份

我尝试使用以下内容:

PS> (Get-AzResource -Name  "func-example").Identity.PrincipalId

但它与对象 ID 不匹配。

然后还有:

PS> (Get-AzWebApp -Name  "func-example" -ResourceGroupName RGNAME).Identity

但也不匹配

有谁知道如何使用 Azure Powershell 获取该 ID?

标签: azurepowershellazure-web-app-serviceazure-powershell

解决方案


你可以这样

使用 PowerShell:

Get-AzADServicePrincipal -DisplayName 'func-example'

使用 CLI:

az ad sp list --display-name 'func-example'

推荐阅读