azdevopsログインがハングする

Sep 25 2020

私はWindows10、Azure PowerShell Azモジュール、DevOps拡張機能0.18.0で作業しています

DevOpsインスタンスにログインし、関連するすべてのコマンドを実行できます。次に、別の組織/プロジェクトにログインする必要があります。loginサブコマンドを実行するたびに、ウィンドウがハングしてロックし、PowerShellISEを再起動して再試行する必要があります。

私が使用しているコマンド(いくつかのバリエーションを試しました)は次のとおりです。

> az login 
> $env:AZURE_DEVOPS_EXT_PAT ='{PAT}' 
> az devops login --organization https://dev.azure.com/{org} --debug

ここにハング!

以下のデバッグログ

az devops login --organization https://dev.azure.com/{org} - デバッグ

CategoryInfo          : NotSpecified: (Command argumen...nn', '--debug']:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError   Event: Cli.PreExecute [] Event: CommandParser.OnGlobalArgumentsCreate
[<function CLILogging.on_global_arguments at 0x03A171E0>, <function 
OutputProducer.on_global_arguments at 0x03B3AA98>, <function
CLIQuery.on_global_arguments at 0x03B5CCD8>] Event:
CommandInvoker.OnPreCommandTableCreate [] Modules found from index for
'devops': ['azext_devops'] Loading command modules: Name              
Load Time    Groups  Commands Total (0)                 0.000        
0         0 These extensions are not installed and will be skipped:
['azext_ai_examples', 'azext_ai_did_you_mean_this'] Loading
extensions: Name                  Load Time    Groups  Commands 
Directory azure-devops              0.110        60       191 
C:\Users\{username}\.azure\cliextensions\azure-devops Total (1)          
0.110        60       191   Loaded 60 groups, 191 commands. Found a match in the command table for 'devops login' Event:
CommandInvoker.OnPreCommandTableTruncate [<function
AzCliLogging.init_command_file_logging at 0x03C2B978>]
az_command_data_logger : command args: devops login --organization {}
--debug metadata file logging enabled - writing logs to 'C:\Users\{username}\.azure\commands'. Event:
CommandInvoker.OnPreArgumentLoad [<function
register_global_subscription_argument.<locals>.add_subscription_parameter
at 0x03D69660>] Event: CommandInvoker.OnPostArgumentLoad [] Event:
CommandInvoker.OnPostCommandTableCreate [<function
register_ids_argument.<locals>.add_ids_arguments at 0x03D69618>,
<function  register_cache_arguments.<locals>.add_cache_arguments at
0x03D69E40>] Event: CommandInvoker.OnCommandTableLoaded [] Event:
CommandInvoker.OnPreParseArgs [] Event: CommandInvoker.OnPostParseArgs
[<function OutputProducer.handle_output_argument at 0x03B3AAE0>,
<function CLIQuery.handle_query_parameter  at 0x03B5CD20>, <function
register_ids_argument.<locals>.parse_ids_arguments at 0x03D69DF8>,
<function DevCommandsLoader.post_parse_args at  0x03CF6150>]
az_command_data_logger : extension name: azure-devops
az_command_data_logger : extension version: 0.18.0
  • Windows10を再起動しました
  • azからログアウトしました(az logout)
  • devopsからログアウトしました(az devops logout)
  • 私は常にPowerShellISEを昇格されたアクセス許可で実行します(管理者)

このすべての後で確認しましたが、開始した組織/プロジェクトから引き続きDevOps(パイプライン、リリースなど)にアクセスできます。そのため、ログアウトも失敗します。

何が起こっている?なぜこれが起こっているのか考えはありますか?

回答

MerlinLiang-MSFT Sep 28 2020 at 05:34

次に、別の組織/プロジェクトにログインする必要があります。

シナリオ1:ターゲット組織/プロジェクトはまだ同じユーザーアカウントの下にあります

使用するターゲット組織/プロジェクトがまだ同じユーザーアカウントの下にある場合は、現時点では、ログアウトして再ログインする必要はありません。

以下のコマンドを実行して、以下を使用してデフォルトの組織/プロジェクトを変更します。

az devops configure --defaults organization=https://dev.azure.com/{org name}

その後、再ログインせずに別の組織/プロジェクトで作業できるようになります。

シナリオ2:ターゲット組織/プロジェクトが別のユーザーアカウントの下にある

実際のシナリオで、その組織/プロジェクトを操作するために別のアカウントでログインするように変更する必要がある場合は、以下のコマンドを実行して最初にログアウトしてください。

az logout --username "{another account}"

次に、再実行az loginして別のアカウントアドレスでログインします。あなたは今成功するはずです。