fix Set-AzsRegistrationSubscription for RBAC workaround

This commit is contained in:
BradleyBartlett 2017-09-21 18:21:50 -07:00
Родитель 41d2bdfc15
Коммит fb8bdf08a2
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -462,6 +462,11 @@ function Set-AzsRegistrationSubscription{
$connection = Connect-AzureAccount -SubscriptionId $CurrentAzureSubscriptionId -AzureEnvironment $AzureEnvironmentName -AzureDirectoryTenantName $AzureDirectoryTenantName -Verbose
$role = Get-AzureRmRoleDefinition -Name 'Registration Reader' -Scope "/subscriptions/$CurrentAzureSubscriptionId"
if (-not $role)
{
$role = Get-AzureRmRoleDefinition -Name "Registration Reader-$($CurrentAzureSubscriptionId)" -Scope "/subscriptions/$CurrentAzureSubscriptionId"
}
if($role)
{
if(-not($role.AssignableScopes -icontains "/subscriptions/$NewAzureSubscriptionId"))