arcus-azure/arcus.scripting

Get-AzCachedAccessToken -AssignGlobalVariables does not assign global variables

Closed this issue · 1 comments

Describe the bug
Get-AzCachedAccessToken -AssignGlobalVariables does not assign global variables
Nor does Get-AzCachedAccessToken -AssignGlobalVariables $True / $False or another variation

To Reproduce
Connect to cloud shell and execute Get-AzCachedAccessToken -AssignGlobalVariables
In the output you can also see that the output produced from following lines never show up

$Global:subscriptionId = $currentAzureContext.Subscription.Id
Write-Host "Global variable 'subscriptionId' assigned"

$Global:accessToken = $token.AccessToken
Write-Host "Global variable 'accessToken' assigned"

Expected behavior
Global variables to be assigned when you use Get-AzCachedAccessToken -AssignGlobalVariables, or global variables to be assigned when you Get-AzCachedAccessToken -AssignGlobalVariables $True (since documentation states that it is a switch default false)

Additional context
Add any other context about the problem here.

  • Using latest version

Aha, thx. That is no good. I think we have a blind spot here in the integration tests. Great to have you contribute.