spring-projects / spring-projects/spring-ai

Spring AI 2 regression authentication to Azure Open AI with custom Credential Builder

Open
#6,935 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

Please do a quick search on GitHub issues first, there might be already a duplicate issue for the one you are about to create.
If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:

Bug description

Switching from Spring Ai 1 to Spring AI 2.0.1 removes UAMI authentication for Azure Foundry models.

See https://github.com/spring-projects/spring-ai/blob/bf122ac7f92b805dd3391387004788456c5c03c6/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/setup/OpenAiSetup.java#L191

->

https://github.com/spring-projects/spring-ai/blob/bf122ac7f92b805dd3391387004788456c5c03c6/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/setup/AzureInternalOpenAiHelper.java#L51

	static Credential getAzureCredential() {
		return getAzureCredential(new DefaultAzureCredentialBuilder().build());
	}

There is no way to override that.

Environment
Spring AI 2.0.1, Java 25

Steps to reproduce
Authenticate against Azure OpenAI with Managed Identity

Expected Behavior

Spring AI 2 supports authentication to Azure Open AI with custom credential builder (UAMI, AASP)

Current Behavior

Spring AI 2 supports only API Key Based auth authentication OR AZURE_CLIENT_ID - single env variable, which limits our multi model configuration.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with models/spring-ai-openai/src/main/java/org/springframework/ai/openai/setup/OpenAiSetup.java around line 191 and AzureInternalOpenAiHelper.java around line 51. Trace how Azure credentials are selected and compare the Spring AI 1 to 2.0.1 behavior. Done means custom credential-builder authentication works for managed identity and multi-model configuration without relying only on an API key or AZURE_CLIENT_ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, java, spring
Domain
authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.