Skip to content

feat(core): support Azure CLI authentication - #45086

Open
opencode-agent[bot] wants to merge 7 commits into
v2from
azure-cli-v2
Open

feat(core): support Azure CLI authentication#45086
opencode-agent[bot] wants to merge 7 commits into
v2from
azure-cli-v2

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Issue for this PR

N/A

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds Microsoft Entra ID authentication through an existing Azure CLI session to the V2 Azure provider and integration architecture.

  • Adds /connectAzureMicrosoft Entra ID (Azure CLI) alongside existing API-key authentication.
  • Uses the V2 credential lifecycle to store and automatically refresh Azure CLI tokens, including older Azure CLI expiration formats.
  • Injects audience-correct bearer credentials into both native and AI SDK requests for Azure OpenAI, Azure model inference, and Microsoft Foundry endpoints.
  • Discovers deployed models, preserves custom deployment names, and supports multiple deployments of the same model.
  • Keeps configured/catalog models usable when the identity lacks the separate Azure management permissions needed for deployment discovery.
  • Supports AZURE_RESOURCE_GROUP to bypass subscription-wide resource enumeration.
  • Documents the complete connection flow, where to find the resource name in Azure Portal or Microsoft Foundry, how to identify it from the endpoint hostname, and an Azure CLI command to list resource names/groups.
  • Covers tenant/subscription selection, inference roles, and V2-native providers.azure.models.*.modelID deployment configuration.

How did you verify your code works?

  • bun test test/plugin/provider-azure.test.ts test/plugin/provider-google-vertex.test.ts test/plugin/provider-github-copilot.test.ts — 50 passing provider/plugin tests.
  • bun typecheck from packages/core.
  • bun typecheck, bun run check:generated, and bun run build from packages/www using Node.js 22.
  • bun x prettier --check packages/core/src/plugin/provider/azure.ts packages/core/test/plugin/provider-azure.test.ts packages/core/test/plugin/fixture.ts packages/www/src/docs/content/providers.mdx.
  • git diff --check origin/v2.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Requested by: @neriousy (Filip via Slack)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant