File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
articles/event-grid/scripts Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 98
98
{
99
99
Write-Host "Creating the Microsoft Entra Application role assignment: " $eventSubscriptionWriterAppId
100
100
$eventGridAppRole = $app.AppRoles | Where-Object -Property "DisplayName" -eq -Value $eventGridRoleName
101
- New-MgServicePrincipalAppRoleAssignment -Id $eventGridAppRole .Id -ResourceId $servicePrincipal.ObjectId -ObjectId $eventSubscriptionWriterSP.ObjectId -PrincipalId $eventSubscriptionWriterSP.ObjectId
101
+ New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $eventSubscriptionWriterSP .Id -PrincipalId $eventSubscriptionWriterSP.Id -ResourceId $servicePrincipal.Id -AppRoleId $eventGridAppRole.Id
102
102
}
103
103
catch
104
104
{
@@ -116,7 +116,7 @@ try {
116
116
# Creates the service app role assignment for Event Grid Microsoft Entra Application
117
117
118
118
$eventGridAppRole = $app.AppRoles | Where-Object -Property "DisplayName" -eq -Value $eventGridRoleName
119
- New-MgServicePrincipalAppRoleAssignment -Id $eventGridAppRole .Id -ResourceId $servicePrincipal.ObjectId -ObjectId $eventGridSP.ObjectId -PrincipalId $eventGridSP.ObjectId
119
+ New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $eventGridSP .Id -PrincipalId $eventGridSP.Id -ResourceId $servicePrincipal.Id -AppRoleId $eventGridAppRole.Id
120
120
121
121
# Print output references for backup
122
122
Original file line number Diff line number Diff line change 92
92
Write-Host "Creating the Microsoft Entra App Role assignment for user: " $eventSubscriptionWriterUserPrincipalName
93
93
$eventSubscriptionWriterUser = Get-MgUser -UserId $eventSubscriptionWriterUserPrincipalName
94
94
$eventGridAppRole = $app.AppRoles | Where-Object -Property "DisplayName" -eq -Value $eventGridRoleName
95
- New-MgUserAppRoleAssignment -Id $eventGridAppRole .Id -ResourceId $servicePrincipal .Id -UserId $eventSubscriptionWriterUser .Id -PrincipalId $eventSubscriptionWriterUser .Id
95
+ New-MgUserAppRoleAssignment -UserId $eventSubscriptionWriterUser .Id -PrincipalId $eventSubscriptionWriterUser .Id -ResourceId $servicePrincipal .Id -AppRoleId $eventGridAppRole .Id
96
96
}
97
97
catch
98
98
{
@@ -110,7 +110,7 @@ try {
110
110
# Creates the service app role assignment for Event Grid Microsoft Entra Application
111
111
112
112
$eventGridAppRole = $app.AppRoles | Where-Object -Property "DisplayName" -eq -Value $eventGridRoleName
113
- New-MgServicePrincipalAppRoleAssignment -Id $eventGridAppRole .Id -ResourceId $servicePrincipal .Id -ServicePrincipalId $eventGridSP .Id -PrincipalId $eventGridSP .Id
113
+ New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $eventGridSP .Id -PrincipalId $eventGridSP .Id -ResourceId $servicePrincipal .Id -AppRoleId $eventGridAppRole .Id
114
114
115
115
# Print output references for backup
116
116
You can’t perform that action at this time.
0 commit comments