Fix for new resource properties and RBAC assignment
Objects returned from Get-AzureRmResource no longer have a SubscriptionId property and so the rbac scope was being built improperly.
This commit is contained in:
Родитель
34f633a709
Коммит
af2e143dfa
|
@ -1206,7 +1206,7 @@ function New-RBACAssignment{
|
|||
Log-Output "Setting $RoleName role on '$($RegistrationResource.ResourceId)'"
|
||||
|
||||
# Determine if RBAC role has been assigned
|
||||
$roleAssignmentScope = "/subscriptions/$($RegistrationResource.SubscriptionId)/resourceGroups/$($RegistrationResource.ResourceGroupName)/providers/Microsoft.AzureStack/registrations/$($RegistrationResource.ResourceName)"
|
||||
$roleAssignmentScope = "/subscriptions/$SubscriptionId/resourceGroups/$($RegistrationResource.ResourceGroupName)/providers/Microsoft.AzureStack/registrations/$($RegistrationResource.ResourceName)"
|
||||
$roleAssignments = Get-AzureRmRoleAssignment -Scope $roleAssignmentScope -ObjectId $ServicePrincipal.ObjectId
|
||||
|
||||
foreach ($role in $roleAssignments)
|
||||
|
|
Загрузка…
Ссылка в новой задаче