How to retrieve App System Assigned Identity Object Id using Azure Powershell

Viewed 1135

I'm using Azure Powershell 3.8.0

I'm trying to fetch the Object ID that can be seen in this screen:

Identity

I tried using the following:

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

But it does not match the Object ID.

then also:

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

But also does not match

Does anyone know how to fetch that ID using Azure Powershell?

1 Answers

You can do this,

With PowerShell :

Get-AzADServicePrincipal -DisplayName 'func-example'

With CLI :

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