Azure / Azure/azure-powershell
Connect-AzAccount hangs when importing Az.Accounts and Az.Storage in the session
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description
This issue is very similar to #19790
My client uses a Powershell script to load data into Storage Account. For this reason the script first installs and imports Az.Accounts and Az.Storage modules with a required version, then it will run Connect-AzAccount with tenant and subscription ids. At this point the script hangs.
This script has worked before with very old versions of these modules, but the version was not enforced. Starting a few weeks ago, a new version was deployed that enforced required versions. This is when they have started experiencing this issue.
**Note:** using -DeviceCode does work and we have implemented that as a workaround.
Here follows a subset of the script that reproduces the issue:
``` Powershell
Write-Host "Starting"
$TenantId = ""
$SubscriptionId = ""
$AzRequiredModules = @(
@{Name = "Az.Accounts"; Version = [Version]"2.12.2"}
,@{Name = "Az.Storage"; Version = [Version]"5.6.0"}
)
$AvailableModules = Get-Module -ListAvailable
$ImportedModules = Get-Module
foreach ($AzModule in $AzRequiredModules) {
# Removing module from session that doesn't fit the required version
$ModulestoRemove = $ImportedModules | Where-Object { $_.Name -eq $AzModule.Name -and $_.Version -ne $AzModule.Version}
$ModulestoRemove | ForEach-Object {
Write-Host "Removing module $($_.Name) $($_.Version) from session..."
Remove-Module -ModuleInfo $_ -Force
}
}
foreach ($AzModule in $AzRequiredModules) {
# Install module if not exists with required minimum
$IsModuleAvailable = !!$($AvailableModules | Where-Object {$_.Name -eq $AzModule.Name -and $_.Version -eq $AzModule.Version})
if (-Not $IsModuleAvailable) {
Write-Host "Installing $($AzModule.Name) $($AzModule.Version)..."
Install-Module -Name $AzModule.Name -RequiredVersion $AzModule.Version -Scope CurrentUser -AllowClobber -Force
}
# Import module if not already present in session
$IsModuleLoaded = !!$(Get-Module | Where-Object {$_.Name -eq $AzModule.Name -and $_.Version -eq $AzModule.Version})
if (-Not $IsModuleLoaded) {
Write-Host "Importing $($AzModule.Name) $($AzModule[1])..."
Import-Module -Name $AzModule.Name -RequiredVersion $AzModule.Version -Scope Local -Force
}
}
Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
if (-Not $(Get-AzContext)) {
Connect-AzAccount -Tenant $tenantId -SubscriptionId $subscriptionId
}
Set-AzContext -Tenant $tenantId -SubscriptionId $subscriptionId
$UserId = $(Get-AzContext).Account.Id
Write-host "User Connected $UserId"
Start-Sleep -Seconds 5
```
you will need to specify the subscription id and tenant id.
I was able to reproduce this issue on a fresh VM with windows 10 and by running the script using cmd.exe and running:
`powershell.exe "path\to\file.ps1"`
As in #19790, you will find that if you comment out line ` ,@{Name = "Az.Storage"; Version = [Version]"5.6.0"}` the Connect-AzAccount command does not hang and script succeeds.
Furthermore, and this is where things get "interesting", if you change the script and add `$DebugPreference = "Continue"` before the Connect-AzAccount, it hangs. If you add it before Clear-AzContext it succeeds.
I know this looks weird, but this was tested in two client laptops (which have a vpn), but I was able to reproduce it using a clean Azure VM without any network restrictions.
The debug output here is for when placing `$DebugPreference='Continue'` directly before `Connect-AzAccount...`:
```
DEBUG: 4:16:03 PM - ConnectAzureRmAccountCommand begin processing with ParameterSet 'UserWithSubscriptionId'.
DEBUG: 4:16:03 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
Returning default value [True].
DEBUG: 4:16:03 PM - Autosave setting from startup session: 'CurrentUser'
DEBUG: 4:16:03 PM - No autosave setting detected in environment variable 'AzContextAutoSave'.
DEBUG: 4:16:03 PM - Using Autosave scope 'CurrentUser'
```
The debug in the next section is for when `$DebugPreference='Continue'` is placed before `Clear-AzContext`
### Issue script & Debug output
```PowerShell
DEBUG: Got version 0 of Az
DEBUG: Got version 0 of Az.Accounts
DEBUG: 3:59:03 PM - ClearAzureRmContext begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 3:59:03 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
Returning default value [True].
DEBUG: 3:59:03 PM - Autosave setting from startup session: 'CurrentUser'
DEBUG: 3:59:03 PM - No autosave setting detected in environment variable 'AzContextAutoSave'.
DEBUG: 3:59:03 PM - Setting Autosave scope to 'CurrentUser' as specified in the cmdlet parameters.
DEBUG: 3:59:03 PM - Using Autosave scope 'CurrentUser'
DEBUG: 3:59:03 PM - Autosave setting from startup session: 'CurrentUser'
DEBUG: 3:59:03 PM - No autosave setting detected in environment variable 'AzContextAutoSave'.
DEBUG: 3:59:03 PM - Setting Autosave scope to 'CurrentUser' as specified in the cmdlet parameters.
DEBUG: 3:59:03 PM - Using Autosave scope 'CurrentUser'
DEBUG: 3:59:03 PM - [ConfigManager] Got nothing from [EnableLoginByWam], Module = [], Cmdlet = []. Returning default
value [False].
DEBUG: 3:59:03 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: AzureQoSEvent: Module: Az.Accounts:2.12.2; CommandName: Clear-AzContext; PSVersion: 5.1.19041.2673; IsSuccess:
True; Duration: 00:00:00.2845396
DEBUG: 3:59:03 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: 3:59:03 PM - ClearAzureRmContext end processing.
DEBUG: 3:59:03 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: 3:59:03 PM - GetAzureRMContextCommand end processing.
DEBUG: 3:59:03 PM - ConnectAzureRmAccountCommand begin processing with ParameterSet 'UserWithSubscriptionId'.
DEBUG: 3:59:03 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
Returning default value [True].
DEBUG: 3:59:03 PM - Autosave setting from startup session: 'CurrentUser'
DEBUG: 3:59:03 PM - No autosave setting detected in environment variable 'AzContextAutoSave'.
DEBUG: 3:59:03 PM - Using Autosave scope 'CurrentUser'
DEBUG: InteractiveBrowserCredential.Authenticate invoked. Scopes: [ https://management.core.windows.net//.default ]
ParentRequestId:
DEBUG: Executing interactive authentication workflow inline.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:03Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] MSAL MSAL.Desktop with assembly version '4.49.1.0'.
CorrelationId(8dc6b798-9703-4cad-8309-c9569c7f3197)
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:03Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] === InteractiveParameters Data ===
LoginHint provided: False
User provided: False
UseEmbeddedWebView: NotSpecified
ExtraScopesToConsent:
Prompt: select_account
HasCustomWebUi: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:03Z -
8dc6b798-9703-4cad-8309-c9569c7f3197]
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenInteractive
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 8dc6b798-9703-4cad-8309-c9569c7f3197
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:03Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] === Token Acquisition (InteractiveRequest) started:
Scopes: https://management.core.windows.net//.default
Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:03Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] [Instance Discovery] Instance discovery is enabled and will be performed
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:03Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:03Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Fetching instance discovery from the network from host login.microsoftonline.com.
DEBUG: Request [1313199f-53c3-4eae-a2b2-a19fc7bd21a7] GET
https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=REDACTED
x-client-SKU:REDACTED
x-client-Ver:REDACTED
x-client-CPU:REDACTED
x-client-OS:REDACTED
client-request-id:REDACTED
return-client-request-id:REDACTED
x-app-name:REDACTED
x-app-ver:REDACTED
x-ms-client-request-id:1313199f-53c3-4eae-a2b2-a19fc7bd21a7
x-ms-return-client-request-id:true
User-Agent:azsdk-net-Identity/1.6.1 (.NET Framework 4.8.4614.0; Microsoft Windows 10.0.19044 )
client assembly: Azure.Identity
DEBUG: Response [1313199f-53c3-4eae-a2b2-a19fc7bd21a7] 200 OK (00.1s)
Strict-Transport-Security:REDACTED
X-Content-Type-Options:REDACTED
Access-Control-Allow-Origin:REDACTED
Access-Control-Allow-Methods:REDACTED
client-request-id:REDACTED
x-ms-request-id:691402e4-8543-49b7-b2c0-29d415c20e00
x-ms-ests-server:REDACTED
X-XSS-Protection:REDACTED
Cache-Control:max-age=86400, private
Content-Type:application/json; charset=utf-8
P3P:REDACTED
Set-Cookie:REDACTED
Date:Tue, 23 May 2023 15:59:03 GMT
Content-Length:980
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:04Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Authority validation enabled? True.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:04Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Authority validation - is known env? True.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:04Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Using legacy embedded browser.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:13Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] [Legacy WebView] Redirect URI was reached. Stopping WebView navigation...
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:13Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] An authorization code was retrieved from the /authorize endpoint.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:13Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Exchanging the auth code for tokens.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:13Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] === InteractiveParameters Data ===
LoginHint provided: False
User provided: False
UseEmbeddedWebView: NotSpecified
ExtraScopesToConsent:
Prompt: select_account
HasCustomWebUi: False
DEBUG: Request [4ced7207-69e9-462c-bf40-834c2dfec755] POST
https://login.microsoftonline.com/REDACTED/oauth2/v2.0/token
x-client-SKU:REDACTED
x-client-Ver:REDACTED
x-client-CPU:REDACTED
x-client-OS:REDACTED
x-anchormailbox:REDACTED
x-client-current-telemetry:REDACTED
x-client-last-telemetry:REDACTED
x-ms-lib-capability:REDACTED
client-request-id:REDACTED
return-client-request-id:REDACTED
x-app-name:REDACTED
x-app-ver:REDACTED
Content-Type:application/x-www-form-urlencoded
x-ms-client-request-id:4ced7207-69e9-462c-bf40-834c2dfec755
x-ms-return-client-request-id:true
User-Agent:azsdk-net-Identity/1.6.1 (.NET Framework 4.8.4614.0; Microsoft Windows 10.0.19044 )
client assembly: Azure.Identity
DEBUG: Response [4ced7207-69e9-462c-bf40-834c2dfec755] 200 OK (01.4s)
Pragma:no-cache
Strict-Transport-Security:REDACTED
X-Content-Type-Options:REDACTED
client-request-id:REDACTED
x-ms-request-id:9a55dbd0-ae64-4634-997b-dc2909ff1000
x-ms-ests-server:REDACTED
x-ms-clitelem:REDACTED
X-XSS-Protection:REDACTED
Cache-Control:no-store, no-cache
Content-Type:application/json; charset=utf-8
Expires:-1
P3P:REDACTED
Set-Cookie:REDACTED
Date:Tue, 23 May 2023 15:59:14 GMT
Content-Length:4708
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Checking client info returned from the server..
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Saving token response to cache..
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] [SaveTokenResponseAsync] Saving AT in cache and removing overlapping ATs...
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Looking for scopes for the authority in the cache which intersect with
https://management.core.windows.net//.default
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Intersecting scope entries count - 0
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Matching entries after filtering by user - 0
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] [SaveTokenResponseAsync] Saving Id Token and Account in cache ...
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] [SaveTokenResponseAsync] Saving RT in cache...
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Not writing FRT in ADAL legacy cache.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197]
=== Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] AT expiration time: 5/23/2023 5:13:22 PM +00:00, scopes:
https://management.core.windows.net//user_impersonation https://management.core.windows.net//.default. source:
IdentityProvider
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
8dc6b798-9703-4cad-8309-c9569c7f3197] Fetched access token from host login.microsoftonline.com.
DEBUG: InteractiveBrowserCredential.Authenticate succeeded. Scopes: [ https://management.core.windows.net//.default ]
ParentRequestId: ExpiresOn: 2023-05-23T17:13:22.6975699+00:00
DEBUG: 3:59:14 PM - [MsalAccessToken] Calling InteractiveBrowserCredential.GetTokenAsync -
Scopes:'https://management.core.windows.net//.default'
DEBUG: InteractiveBrowserCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ]
ParentRequestId:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] MSAL MSAL.Desktop with assembly version '4.49.1.0'.
CorrelationId(e98acb60-9b72-40fb-b604-abadd1880dd1)
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] LoginHint provided: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] Account provided: True
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] ForceRefresh: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1]
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - e98acb60-9b72-40fb-b604-abadd1880dd1
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] === Token Acquisition (SilentRequest) started:
Scopes: https://management.core.windows.net//.default
Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] Access token is not expired. Returning the found cache entry. [Current time
(05/23/2023 15:59:14) - Expiration Time (05/23/2023 17:13:22 +00:00) - Extended Expiration Time (05/23/2023 17:13:22
+00:00)]
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1]
=== Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:14Z -
e98acb60-9b72-40fb-b604-abadd1880dd1] AT expiration time: 5/23/2023 5:13:22 PM +00:00, scopes:
https://management.core.windows.net//user_impersonation https://management.core.windows.net//.default. source: Cache
DEBUG: InteractiveBrowserCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ]
ParentRequestId: ExpiresOn: 2023-05-23T17:13:22.0000000+00:00
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://management.azure.com/subscriptions/REDACTED?api-version=2021-01-01
Headers:
x-ms-client-request-id : daef35f9-9b57-4134-b6d5-a57c5e49ca84
accept-language : en-US
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Pragma : no-cache
x-ms-ratelimit-remaining-subscription-reads: 11999
x-ms-request-id : 06ae93ba-c586-48cf-8ffa-991f19783a04
x-ms-correlation-request-id : 06ae93ba-c586-48cf-8ffa-991f19783a04
x-ms-routing-request-id : WESTEUROPE:20230523T155914Z:06ae93ba-c586-48cf-8ffa-991f19783a04
Strict-Transport-Security : max-age=31536000; includeSubDomains
X-Content-Type-Options : nosniff
Cache-Control : no-cache
Date : Tue, 23 May 2023 15:59:14 GMT
Body:
{
"id": "/subscriptions/REDACTED",
"authorizationSource": "RoleBased",
"managedByTenants": [
{
"tenantId": "REDACTED"
}
],
"tags": {REDACTED},
"subscriptionId": "REDACTED",
"tenantId": "REDACTED",
"displayName": "REDACTED",
"state": "Enabled",
"subscriptionPolicies": {REDACTED}
}
DEBUG: 3:59:15 PM - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync -
TenantId:'REDACTED', Scopes:'https://management.core.windows.net//.default',
AuthorityHost:'https://login.microsoftonline.com/', UserId:'REDACTED'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ]
ParentRequestId:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
26d59c44-dc1f-46a6-883f-be3e5d8ed65f] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
26d59c44-dc1f-46a6-883f-be3e5d8ed65f] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
26d59c44-dc1f-46a6-883f-be3e5d8ed65f] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
26d59c44-dc1f-46a6-883f-be3e5d8ed65f] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
26d59c44-dc1f-46a6-883f-be3e5d8ed65f] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z] Found 1 cache accounts and 0
broker accounts
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z] Returning 1 accounts
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] MSAL MSAL.Desktop with assembly version '4.49.1.0'.
CorrelationId(29014657-af2a-4844-874c-64cbdf9d82b0)
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] LoginHint provided: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] Account provided: True
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] ForceRefresh: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0]
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 29014657-af2a-4844-874c-64cbdf9d82b0
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] === Token Acquisition (SilentRequest) started:
Scopes: https://management.core.windows.net//.default
Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] Access token is not expired. Returning the found cache entry. [Current time
(05/23/2023 15:59:15) - Expiration Time (05/23/2023 17:13:22 +00:00) - Extended Expiration Time (05/23/2023 17:13:22
+00:00)]
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0]
=== Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:15Z -
29014657-af2a-4844-874c-64cbdf9d82b0] AT expiration time: 5/23/2023 5:13:22 PM +00:00, scopes:
https://management.core.windows.net//user_impersonation https://management.core.windows.net//.default. source: Cache
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ]
ParentRequestId: ExpiresOn: 2023-05-23T17:13:22.0000000+00:00
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://management.azure.com/subscriptions?api-version=2021-01-01
Headers:
x-ms-client-request-id : daef35f9-9b57-4134-b6d5-a57c5e49ca84
accept-language : en-US
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Pragma : no-cache
x-ms-ratelimit-remaining-tenant-reads: 11999
x-ms-request-id : 8994cc3d-f337-4a14-9283-ba56d2ee7796
x-ms-correlation-request-id : 8994cc3d-f337-4a14-9283-ba56d2ee7796
x-ms-routing-request-id : WESTEUROPE:20230523T155915Z:8994cc3d-f337-4a14-9283-ba56d2ee7796
Strict-Transport-Security : max-age=31536000; includeSubDomains
X-Content-Type-Options : nosniff
Cache-Control : no-cache
Date : Tue, 23 May 2023 15:59:15 GMT
Body:
{
"value": [
{
"id": "/subscriptions/REDACTED",
"authorizationSource": "RoleBased",
"managedByTenants": [
{
"tenantId": "REDACTED"
}
],
"tags": {REDACTED},
"subscriptionId": "REDACTED",
"tenantId": "REDACTED",
"displayName": "REDACTED",
"state": "Enabled",
"subscriptionPolicies": {REDACTED}
},
{
"id": "/subscriptions/REDACTED",
"authorizationSource": "RoleBased",
"managedByTenants": [
{
"tenantId": "REDACTED"
}
],
"tags": {REDACTED},
"subscriptionId": "REDACTED",
"tenantId": "REDACTED",
"displayName": "REDACTED",
"state": "Enabled",
"subscriptionPolicies": {REDACTED}
},
{
"id": "/subscriptions/REDACTED",
"authorizationSource": "RoleBased",
"managedByTenants": [],
"tags": {REDACTED},
"subscriptionId": "REDACTED",
"tenantId": "REDACTED",
"displayName": "REDACTED",
"state": "Enabled",
"subscriptionPolicies": {REDACTED}
}
],
"count": {
"type": "Total",
"value": 3
}
}
DEBUG: 3:59:16 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: AzureQoSEvent: Module: Az.Accounts:2.12.2; CommandName: Connect-AzAccount; PSVersion: 5.1.19041.2673;
IsSuccess: True; Duration: 00:00:12.4630436
DEBUG: 3:59:16 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: 3:59:16 PM - ConnectAzureRmAccountCommand end processing.
DEBUG: 3:59:16 PM - SetAzureRMContextCommand begin processing with ParameterSet 'Subscription'.
DEBUG: 3:59:16 PM - using account id 'REDACTED'...
DEBUG: 3:59:16 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
Returning default value [True].
DEBUG: 3:59:16 PM - Autosave setting from startup session: 'CurrentUser'
DEBUG: 3:59:16 PM - No autosave setting detected in environment variable 'AzContextAutoSave'.
DEBUG: 3:59:16 PM - Using Autosave scope 'CurrentUser'
DEBUG: 3:59:16 PM - [ConfigManager] Got nothing from [EnableLoginByWam], Module = [], Cmdlet = []. Returning default
value [False].
DEBUG: 3:59:16 PM - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync -
TenantId:'REDACTED', Scopes:'https://management.core.windows.net//.default',
AuthorityHost:'https://login.microsoftonline.com/', UserId:'REDACTED'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ]
ParentRequestId:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
ca657f56-2346-4d8c-b0f0-317d1ea6d5c3] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
ca657f56-2346-4d8c-b0f0-317d1ea6d5c3] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
ca657f56-2346-4d8c-b0f0-317d1ea6d5c3] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
ca657f56-2346-4d8c-b0f0-317d1ea6d5c3] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
ca657f56-2346-4d8c-b0f0-317d1ea6d5c3] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z] Found 1 cache accounts and 0
broker accounts
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z] Returning 1 accounts
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] MSAL MSAL.Desktop with assembly version '4.49.1.0'.
CorrelationId(2577010d-42c1-4a2b-b186-3f2907d50621)
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] LoginHint provided: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] Account provided: True
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] ForceRefresh: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621]
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 2577010d-42c1-4a2b-b186-3f2907d50621
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] === Token Acquisition (SilentRequest) started:
Scopes: https://management.core.windows.net//.default
Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] Access token is not expired. Returning the found cache entry. [Current time
(05/23/2023 15:59:16) - Expiration Time (05/23/2023 17:13:22 +00:00) - Extended Expiration Time (05/23/2023 17:13:22
+00:00)]
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621]
=== Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2023-05-23 15:59:16Z -
2577010d-42c1-4a2b-b186-3f2907d50621] AT expiration time: 5/23/2023 5:13:22 PM +00:00, scopes:
https://management.core.windows.net//user_impersonation https://management.core.windows.net//.default. source: Cache
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ]
ParentRequestId: ExpiresOn: 2023-05-23T17:13:22.0000000+00:00
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://management.azure.com/subscriptions/REDACTED?api-version=2021-01-01
Headers:
x-ms-client-request-id : 0d9ca635-d034-4aac-9506-ed15b16a9636
accept-language : en-US
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Pragma : no-cache
x-ms-ratelimit-remaining-subscription-reads: 11999
x-ms-request-id : 72743762-92d3-48d3-a8ca-38d50ca1a28b
x-ms-correlation-request-id : 72743762-92d3-48d3-a8ca-38d50ca1a28b
x-ms-routing-request-id : WESTEUROPE:20230523T155916Z:72743762-92d3-48d3-a8ca-38d50ca1a28b
Strict-Transport-Security : max-age=31536000; includeSubDomains
X-Content-Type-Options : nosniff
Cache-Control : no-cache
Date : Tue, 23 May 2023 15:59:15 GMT
Body:
{
"id": "/subscriptions/REDACTED",
"authorizationSource": "RoleBased",
"managedByTenants": [
{
"tenantId": "REDACTED"
}
],
"tags": {REDACTED},
"subscriptionId": "REDACTED",
"tenantId": "REDACTED",
"displayName": "REDACTED",
"state": "Enabled",
"subscriptionPolicies": {REDACTED}
}
DEBUG: 3:59:16 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: AzureQoSEvent: Module: Az.Accounts:2.12.2; CommandName: Set-AzContext; PSVersion: 5.1.19041.2673; IsSuccess:
True; Duration: 00:00:00.2102874
DEBUG: 3:59:16 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: 3:59:16 PM - SetAzureRMContextCommand end processing.
DEBUG: 3:59:16 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning
default value [True].
DEBUG: 3:59:16 PM - GetAzureRMContextCommand end processing.
```
### Environment data
```PowerShell
Name Value
---- -----
PSVersion 5.1.19041.2673
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.2673
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```
### Module versions
```PowerShell
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.12.2 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzCo...
Script 5.6.0 Az.Storage {Add-AzRmStorageContainerLegalHold, Add-AzStor...
```
### Error output
```PowerShell
No error... just hangs
```
Contributor guide
Assessment
This issue has not been assessed yet.