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:
Bradley Bartlett 2018-05-09 16:04:22 -07:00 коммит произвёл GitHub
Родитель 34f633a709
Коммит af2e143dfa
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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)