liveBook · Manning

Azure OpenAI

As explained in Spring AI in Action

Azure OpenAI is Microsoft's Azure-hosted service for accessing OpenAI models through Azure infrastructure and authentication.

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

How Spring AI in Action covers it

How deep it goes
Specifies the provider starter, API-key configuration, and deployment-name property without detailing Azure service internals.
Examples
Uses the Azure starter, an Azure API-key environment variable, and a GPT-4 deployment property.
What it assumes
Requires Azure access and an API key, while Spring AI supplies the integration dependency and configuration model.
What you can do after
Configure a Spring AI application to send prompts to a selected Azure OpenAI deployment.
How it connects
Connects Spring AI, OpenAI models, API keys, model deployments, and cloud AI providers.

Also explained in

Compare how 3 books explain Azure OpenAI →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.