Azure / Azure/azure-powershell
Connect-AzAccount hangs in Visual Studio Code terminal
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description
When using "Connect-AzAccount" it hangs in the terminal with the message "Please select the account you want to login with."
I can't actually select a subscription however, it just hangs at that point with a "pop-behind" login prompt. That is, the Windows authentication UI appears *under* the Visual Studio Code window.
PS: The exact same behavior is observed with Out-GridView, or any other PowerShell GUI element launched from the VS Code console.
### Issue script & Debug output
```PowerShell
Connect-AzAccount
DEBUG: 12:51:35 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:51:35 PM - ConnectAzureRmAccountCommand begin processing with ParameterSet 'UserWithSubscriptionId'.
DEBUG: 12:51:35 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:51:35 PM - [ConfigManager] Got [########-####-####-####-#########] from [DefaultSubscriptionForLogin], Module = [], Cmdlet = [].
DEBUG: 12:51:35 PM - [ConnectAzureRmAccountCommand] Using default subscription "########-####-####-####-#########" from config.
DEBUG: 12:51:35 PM - Autosave setting from startup session: 'CurrentUser'
DEBUG: 12:51:35 PM - No autosave setting detected in environment variable 'AzContextAutoSave'.
DEBUG: 12:51:35 PM - Using Autosave scope 'CurrentUser'
Please select the account you want to login with.
```
### Environment data
```PowerShell
Name Value
---- -----
PSVersion 7.4.2
PSEdition Core
GitCommitId 7.4.2
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```
### Module versions
```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 3.0.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
```
### Error output
```PowerShell
DEBUG: 12:53:11 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:53:11 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 12:53:11 PM - using account id 'username@orgname.onmicrosoft.com'...
DEBUG: 12:53:11 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:53:11 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:53:11 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent: Module: Az.Accounts:3.0.0; CommandName: Resolve-AzError; PSVersion: 7.4.2; IsSuccess: True; Duration: 00:00:00.0025570; SanitizeDuration: 00:00:00
DEBUG: 12:53:11 PM - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
DEBUG: 12:53:11 PM - ResolveError end processing.
```
Contributor guide
Assessment
This issue has not been assessed yet.