Account can't be found using (dotnet) code relying on Azure CLI credentials

オープン
#1,190 コメント 3 件 リアクション 0 件 担当者 2 名 GitHub で見る

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

@isra-fel がすでに取り組んでいます。

2026年10月28日 から。

評価

この issue はまだ評価されていません。

説明

act-identity-squad
Affected surface

CLI (az)

Describe the bug

In our solution(s) we are relying on Managed Identities to connect with resources.
For our local environments, we use the Azure CLI identity for this and grant the engineers access to several of those resources.

The code, in csharp, looks pretty much like this:

var credential = new DefaultAzureCredential();

return new CosmosClient(
    accountEndpoint: accountEndpoint,
    tokenCredential: credential
);

I'm not sure on the internals of how this works, but it's safe to assume it relies on the az account module.
When running a command like

if az account show >/dev/null 2>&1; then echo 'Azure CLI has an active account'; else echo 'Azure CLI has no active account'; fi

It states no active account can't be found. Needless to say, I am logged in, but the az account isn't supported (yet?).

For me, this is blocking the usage of azclips at the moment, as I can't connect to our resources anymore.

I'm pretty sure this is probably somewhere on the roadmap, but I couldn't find it listed in the Issues yet.

Related command
az account show
Steps to reproduce
  1. az login --tenant-id --subscription-id -out-profile customer
  2. az account show // See an error occur
  3. Run this in the codebase
var credential = new DefaultAzureCredential();

return new CosmosClient(
    accountEndpoint: accountEndpoint,
    tokenCredential: credential
);
Errors & debug output
No real error, aside from the `account` module not existing.
Expected behavior

This to be on the roadmap, so we can use the logged in azclips identity to connect with Azure resources depending on actual identities.

Environment
az version
{
  "azCli": "0.1.6",
  "runtime": {
    "dotNet": ".NET 10.0.14",
    "os": "macOS 27.0.1",
    "architecture": "Arm64"
  }
}
Additional context

No response

主要言語
C#
スター
18
フォーク
10
平均マージ
1日 20時間
マージ済み PR(30日)
157

環境構築

Codespaces で開く

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

はじめの一歩

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

Azure/azclips のほかの issue

Azure/azclips の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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