Azure OpenAI provides access to OpenAI models through Microsoft Azure rather than OpenAI’s directly hosted service. Spring AI treats it as a separate provider with its own starter, credentials, and deployment configuration. section 1.2.1 section 1.2
Configure a Spring AI application by:
- Adding the Azure OpenAI starter dependency. section 1.2.1
- Providing an Azure-specific API key through application properties or the SPRING_AI_AZURE_OPENAI_API_KEY environment variable. section 1.2.1
- Selecting the deployed model with spring.ai.azure.openai.chat.options.deployment-name. section 1.2.1
Select a deployment
Set spring.ai.azure.openai.chat.options.deployment-name=gpt-4 to direct prompts to the GPT-4 deployment instead of the default GPT-4o-mini deployment. section 1.2.1
implementation
'org.springframework.ai:spring-ai-starter-model-azure-openai'
Use the Azure-specific Spring AI starter when integrating Azure OpenAI into the application. section 1.2.1


