fix Set-AzsRegistrationSubscription for RBAC workaround
This commit is contained in:
Родитель
41d2bdfc15
Коммит
fb8bdf08a2
|
@ -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"))
|
||||
|
|
Загрузка…
Ссылка в новой задаче