Skip to content

Commit af59e70

Browse files
committed
Update after re-testing
1 parent 1339cfd commit af59e70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

articles/active-directory/managed-identities-azure-resources/how-to-assign-app-role-managed-identity-powershell.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.subservice: msi
1212
ms.topic: how-to
1313
ms.tgt_pltfrm: na
1414
ms.workload: identity
15-
ms.date: 09/06/2023
15+
ms.date: 09/07/2023
1616
ms.author: jodowns
1717
ms.collection: M365-identity-device-management
1818
ms.custom: has-azure-ad-ps-ref
@@ -131,12 +131,12 @@ Connect-MgGraph -TenantId $tenantId -Scopes 'Application.Read.All','Application.
131131
132132
# Look up the details about the server app's service principal and app role.
133133
$serverServicePrincipal = (Get-MgServicePrincipal -Filter "DisplayName eq '$serverApplicationName'")
134-
$serverServicePrincipalObjectId = $serverServicePrincipal.ObjectId
134+
$serverServicePrincipalObjectId = $serverServicePrincipal.Id
135135
$appRoleId = ($serverServicePrincipal.AppRoles | Where-Object {$_.Value -eq $appRoleName }).Id
136136
137137
# Assign the managed identity access to the app role.
138138
New-MgServicePrincipalAppRoleAssignment `
139-
-ServicePrincipalId $managedIdentityObjectId `
139+
-ServicePrincipalId $serverServicePrincipalObjectId `
140140
-PrincipalId $managedIdentityObjectId `
141141
-ResourceId $serverServicePrincipalObjectId `
142142
-AppRoleId $appRoleId

0 commit comments

Comments
 (0)