Connect-AzAccount interactive login fails on macOS (Apple Silicon): "Interactive requests with mac broker enabled must be executed on the main thread"

オープン
#29,941 コメント 4 件 リアクション 5 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp, powershell

調査の方向性

まず、Az.Accounts 5.5.1 を使用して macOS Apple Silicon 上で Connect-AzAccount を再現し、次に 5.2.0 および回避策 -UseDeviceAuthentication と比較します。インタラクティブなブラウザー フローとその MSAL mac-broker パスを追跡します。標準コマンドでメインスレッド エラーなしにブラウザーが開けば完了です。

索引モデルが issue の本文から書いたものです。

説明

customer-reported Similar-Issue
Description

Connect-AzAccount (interactive browser flow) fails on macOS with the following error, starting in Az.Accounts 5.5.1:

WARNING: Unable to acquire token for tenant 'organizations' with error
'InteractiveBrowserCredential authentication failed: Interactive requests
with mac broker enabled must be executed on the main thread on macOS.'
Connect-AzAccount: InteractiveBrowserCredential authentication failed:
Interactive requests with mac broker enabled must be executed on the main
thread on macOS.
Environment
  • Az.Accounts version (broken): 5.5.1
  • Az.Accounts version (last known good): 5.2.0
  • OS: macOS (Apple Silicon)
  • PowerShell: 7.6.4 (pwsh)
  • Shell/terminal: zsh, running inside Ghostty
Steps to reproduce
  1. Install Az.Accounts 5.5.1 (via Install-Module -Name Az -Repository PSGallery)
  2. Run Connect-AzAccount
  3. Observe the error above instead of a browser window opening
Expected behavior

Interactive browser login opens as it did on 5.2.0.

Workaround found

Downgrading fixes it:

Uninstall-Module Az.Accounts -AllVersions -Force
Install-Module -Name Az.Accounts -RequiredVersion 5.2.0 -Repository PSGallery -Force -AllowClobber

Connect-AzAccount -UseDeviceAuthentication also works around it without downgrading, but the standard interactive flow should not require this.

Additional notes

This appears to be caused by the MSAL mac-broker interactive auth path requiring main-thread execution, which isn't guaranteed when pwsh is run from a non-default terminal host.


Duplicate of #29940 (filed from a different account by mistake; leaving that one open too so a maintainer can dedupe).

主要言語
C#
スター
4.8k
フォーク
4.3k
平均マージ
2日 18時間
マージ済み PR(30日)
91

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure/azure-powershell のほかの issue

Azure/azure-powershell の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。