claude-code - 💡(How to fix) Fix Cloud sessions: non-interactive Azure CLI auth path

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

I'm using Claude Code on the web (cloud sessions) for a solo build of a healthcare-billing SaaS on Azure. Phase 1 substrate provisioning uses Bicep + GitHub Actions OIDC, which works fine in cloud. Beyond that, every Phase 2+ task that wants ad-hoc Azure CLI introspection from a phone-driven cloud session hits the same wall: there's no path to authenticate az non-interactively in the cloud sandbox.

Cloud sessions can install az (my SessionStart hook handles this), but there's no az login device-code flow available, no service-principal credentials injected into the sandbox env, no federated identity assertion exposed.

Root Cause

I'm using Claude Code on the web (cloud sessions) for a solo build of a healthcare-billing SaaS on Azure. Phase 1 substrate provisioning uses Bicep + GitHub Actions OIDC, which works fine in cloud. Beyond that, every Phase 2+ task that wants ad-hoc Azure CLI introspection from a phone-driven cloud session hits the same wall: there's no path to authenticate az non-interactively in the cloud sandbox.

Cloud sessions can install az (my SessionStart hook handles this), but there's no az login device-code flow available, no service-principal credentials injected into the sandbox env, no federated identity assertion exposed.

Fix Action

Fix / Workaround

Today's workaround stack

  • Azure MCP server for read ops (authed via its own MCP-internal flow)
  • GitHub Actions OIDC for write ops (deploy via PR + workflow_dispatch)
  • Fall back to desktop session for ad-hoc az work
RAW_BUFFERClick to expand / collapse

Context

I'm using Claude Code on the web (cloud sessions) for a solo build of a healthcare-billing SaaS on Azure. Phase 1 substrate provisioning uses Bicep + GitHub Actions OIDC, which works fine in cloud. Beyond that, every Phase 2+ task that wants ad-hoc Azure CLI introspection from a phone-driven cloud session hits the same wall: there's no path to authenticate az non-interactively in the cloud sandbox.

Cloud sessions can install az (my SessionStart hook handles this), but there's no az login device-code flow available, no service-principal credentials injected into the sandbox env, no federated identity assertion exposed.

Today's workaround stack

  • Azure MCP server for read ops (authed via its own MCP-internal flow)
  • GitHub Actions OIDC for write ops (deploy via PR + workflow_dispatch)
  • Fall back to desktop session for ad-hoc az work

Acceptable for Phase 1 substrate, but Phase 2+ ad-hoc Azure work from a phone-driven cloud session is blocked.

Two viable shapes

  1. Federated identity credential — Claude Code on the web exposes an OIDC token issuer for cloud session identity. The user registers a federated credential on a service principal in their tenant trusting that issuer (with a subject claim like claude-cloud-session:<environment-id>). SessionStart hook runs az login --service-principal --federated-token <assertion>. Cleanest — no shared secrets.

  2. Environment-injected SP credentials — env-var injection for AZURE_CLIENT_ID / AZURE_TENANT_ID / AZURE_CLIENT_SECRET (or AZURE_FEDERATED_TOKEN_FILE), same mechanism currently used for GH_TOKEN / GITHUB_MCP_PAT. Hook runs az login --service-principal non-interactively.

What I'd like to know

  • Does cloud Claude Code expose an OIDC identity-token issuer for session identity (for shape 1)? If yes: issuer URL + subject claim format + audience to use for federation.
  • If not, is the existing GH_TOKEN-style env-secret injection extensible to multiple Azure-SP variables (for shape 2)?
  • Roadmap timing if neither is available today.

Preference: shape 1 if available; shape 2 acceptable fallback. Both flow through a SessionStart hook (ensure_az_auth parallel to ensure_gh_auth).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING