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

Abierto
#1,190 3 comentarios 0 reacciones 2 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@isra-fel ya está trabajando en esto.

Desde el 28/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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

Lenguaje dominante
C#
Estrellas
18
Forks
10
Merge medio
1 d 20 h
PR fusionados (30 d)
157

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/azclips

Todos los issues de Azure/azclips

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.