Azure AI Foundry
The Azure AI Foundry plugin provides access to models hosted on Azure.
Installation
Section titled “Installation”<dependency> <groupId>com.google.genkit</groupId> <artifactId>genkit-plugin-azure-foundry</artifactId> <version>1.0.0-SNAPSHOT</version></dependency>Configuration
Section titled “Configuration”export AZURE_AI_FOUNDRY_ENDPOINT=https://your-endpoint.inference.ai.azure.comexport AZURE_AI_FOUNDRY_API_KEY=your-api-keyAlternatively, supports Azure Managed Identity authentication.
import com.google.genkit.plugins.azurefoundry.AzureFoundryPlugin;
Genkit genkit = Genkit.builder() .plugin(AzureFoundryPlugin.create()) .build();
ModelResponse response = genkit.generate( GenerateOptions.builder() .model("azure-foundry/gpt-4o") .prompt("Tell me about AI") .build());Available models
Section titled “Available models”- GPT-5, GPT-4o, o1, o3-mini
- Grok, Llama, DeepSeek
- Claude 4.x via Azure marketplace
- And many more
Session store
Section titled “Session store”The plugin also ships CosmosSessionStore, an Azure Cosmos DB-backed agent session store. Construct it and pass it to an agent’s .store(...) to persist server-managed sessions in Cosmos DB:
import com.google.genkit.plugins.azurefoundry.session.CosmosSessionStore;import com.azure.cosmos.CosmosClientBuilder;
CosmosSessionStore<Map<String, Object>> store = new CosmosSessionStore<>( new CosmosClientBuilder() .endpoint(System.getenv("COSMOS_ENDPOINT")) .key(System.getenv("COSMOS_KEY")) .buildClient());See Session Stores for options and the agents-cosmos-session sample.
Sample
Section titled “Sample”See the azure-foundry sample.