Skip to content

Commit

Permalink
Az.StackHCI - Pass GraphAccessToken to Connect-AzAccount (Azure#15193) (
Browse files Browse the repository at this point in the history
Azure#15203)

New-AzRoleAssignment Cmdlet needs graph token, so during Connect-AzAccount pass GraphAccessToken

Co-authored-by: digot007 <[email protected]>
  • Loading branch information
msJinLei and digot007 authored Jun 8, 2021
1 parent f1f2eff commit df04152
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/StackHCI/Az.StackHCI.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -910,11 +910,11 @@ param(

if([string]::IsNullOrEmpty($TenantId))
{
Connect-AzAccount -Environment $ConnectAzAccountEnvironmentName -SubscriptionId $SubscriptionId -AccessToken $ArmAccessToken -AccountId $AccountId -Scope Process | Out-Null
Connect-AzAccount -Environment $ConnectAzAccountEnvironmentName -SubscriptionId $SubscriptionId -AccessToken $ArmAccessToken -AccountId $AccountId -GraphAccessToken $GraphAccessToken -Scope Process | Out-Null
}
else
{
Connect-AzAccount -Environment $ConnectAzAccountEnvironmentName -TenantId $TenantId -SubscriptionId $SubscriptionId -AccessToken $ArmAccessToken -AccountId $AccountId -Scope Process | Out-Null
Connect-AzAccount -Environment $ConnectAzAccountEnvironmentName -TenantId $TenantId -SubscriptionId $SubscriptionId -AccessToken $ArmAccessToken -AccountId $AccountId -GraphAccessToken $GraphAccessToken -Scope Process | Out-Null
}

Write-Progress -Id $MainProgressBarId -activity $ProgressActivityName -status $ConnectingToAzureAD -percentcomplete 35
Expand Down

0 comments on commit df04152

Please sign in to comment.