#6935·spring-ai

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

Author: hepextaCreated Sep 7, 2026Updated Sep 14, 2026
Labelsstatus: waiting-for-triage

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.

Source: spring-projects/spring-ai