azure-ai-projects-java
microsoft/agent-skills/.github/plugins/azure-sdk-java/skills/azure-ai-projects-java/SKILL.md
Azure AI Projects SDK for Java. High-level SDK for Azure AI Foundry project management including connections, datasets, indexes, and evaluations. Triggers: "AIProjectClient java", "azure ai projects java", "Foundry project java", "ConnectionsClient", "DatasetsClient", "IndexesClient".
Skill3.1k starsChanged 8 months ago
What's in it
- Azure AI Projects SDK for Java
- Installation
- Environment Variables
- Authentication
- Client Hierarchy
- Core Operations
- List Connections
- List Indexes
- Create or Update Index
- Access OpenAI Evaluations
- Best Practices
- Error Handling
- Reference Links
---
name: azure-ai-projects-java
description: |
Azure AI Projects SDK for Java. High-level SDK for Azure AI Foundry project management including connections, datasets, indexes, and evaluations.
Triggers: "AIProjectClient java", "azure ai projects java", "Foundry project java", "ConnectionsClient", "DatasetsClient", "IndexesClient".
license: MIT
metadata:
author: Microsoft
version: "1.0.0"
package: com.azure:azure-ai-projects
---
# Azure AI Projects SDK for Java
High-level SDK for Azure AI Foundry project management with access to connections, datasets, indexes, and evaluations.
## Installation
```xml
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-ai-projects</artifactId>
<version>1.0.0-beta.1</version>
</dependency>
```
## Environment Variables
```bash
PROJECT_ENDPOINT=https://<resource>.services.ai.azure.com/api/projects/<project> # Required for project configuration
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production
```
## Authentication
```java
import com.azure.ai.projects.AIProjectClientBuilder;
import com.azure.core.credential.TokenCredential;
import com.azure.identity.AzureIdentityEnvVars;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.identity.ManagedIdentityCredentialBuilder;
TokenCredential credential = new DefaultAzureCredentialBuilder()
.requireEnvVars(AzureIdentityEnvVars.AZURE_TOKEN_CREDENTIALS)
.build();
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable#credential-classes
// TokenCredential credential = new ManagedIdentityCredentialBuilder().build();
AIProjectClientBuilder builder = new AIProjectClientBuilder()
.endpoint(System.getenv("PROJECT_ENDPOINT"))
.credential(credential);
```
## Client Hierarchy
The SDK provides multiple sub-clients for different operations:
| Client | Purpose |
|--------|---------|
| `ConnectionsClient` | Enumerate connected Azure resources |
| `DatasetsClient` | Upload documents and manage datasets |
| `DeploymentsClient` | Enumerate AI model deployments |
| `IndexesClient` | Create and manage search indexes |
| `EvaluationsClient` | Run AI model evaluations |
| `EvaluatorsClient` | Manage evaluator configurations |
| `SchedulesClient` | Manage scheduled operations |
```java
// Build sub-clients from builder
ConnectionsClient connectionsClient = builder.buildConnectionsClient();
DatasetsClient datasetsClient = builder.buildDatasetsClient();
DeploymentsClient deploymentsClient = builder.buildDeploymentsClient();
IndexesClient indexesClient = builder.buildIndexesClient();
EvaluationsClient evaluationsClient = builder.buildEvaluationsClient();
```
## Core Operations
### List Connections
```java
import com.azure.ai.projects.models.Connection;
import com.azure.core.http.rest.PagedIterable;
PagedIterable<Connection> connections = connectionsClient.listConnections();
for (Connection connection : connections) {
System.out.println("Name: " + connection.getName());
System.out.println("Type: " + connection.getType());
System.out.println("Credential Type: " + connection.getCredentials().getType());
}
```
### List Indexes
```java
indexesClient.listLatest().forEach(index -> {
System.out.println("Index name: " + index.getName());
System.out.println("Version: " + index.getVersion());
System.out.println("Description: " + index.getDescription());
});
```
### Create or Update Index
```java
import com.azure.ai.projects.models.AzureAISearchIndex;
import com.azure.ai.projects.models.Index;
String indexName = "my-index";
String indexVersion = "1.0";
String searchConnectionName = System.getenv("AI_SEARCH_CONNECTION_NAME");
String searchIndexName = System.getenv("AI_SEARCH_INDEX_NAME");
Index index = indexesClient.createOrUpdate(
indexName,
indexVersion,
new AzureAISearchIndex()
.setConnectionName(searchConnectionName)
.setIndexName(searchIndexName)
);
System.out.println("Created index: " + index.getName());
```
### Access OpenAI Evaluations
The SDK exposes OpenAI's official SDK for evaluations:
```java
import com.openai.services.EvalService;
EvalService evalService = evaluationsClient.getOpenAIClient();
// Use OpenAI evaluation APIs directly
```
## Best Practices
1. **Use DefaultAzureCredential** for production authentication
2. **Reuse client builder** to create multiple sub-clients efficiently
3. **Handle pagination** when listing resources with `PagedIterable`
4. **Use environment variables** for connection names and configuration
5. **Check connection types** before accessing credentials
## Error Handling
```java
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceNotFoundException;
try {
Index index = indexesClient.get(indexName, version);
} catch (ResourceNotFoundException e) {
System.err.println("Index not found: " + indexName);
} catch (HttpResponseException e) {
System.err.println("Error: " + e.getResponse().getStatusCode());
}
```
## Reference Links
| Resource | URL |
|----------|-----|
| Product Docs | https://learn.microsoft.com/azure/ai-studio/ |
| API Reference | https://learn.microsoft.com/rest/api/aifoundry/aiprojects/ |
| GitHub Source | https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-projects |
| Samples | https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-projects/src/samples |
More agent context in microsoft/agent-skills
211 other files this repository gives its agents, the first 60 shown.
AGENTS.md
Copilot instructions
llms.txt
Skill
- cost-analysis.github/plugins/azure-cost/skills/cost-analysis/SKILL.md
- cost-estimation.github/plugins/azure-cost/skills/cost-estimation/SKILL.md
- cost-governance.github/plugins/azure-cost/skills/cost-governance/SKILL.md
- cost-optimization.github/plugins/azure-cost/skills/cost-optimization/SKILL.md
- azure-kusto-graph.github/plugins/azure-kusto-graph-skills/skills/azure-kusto-graph/SKILL.md
- azure-kusto-irql-graph.github/plugins/azure-kusto-graph-skills/skills/azure-kusto-irql-graph/SKILL.md
- azure-kusto-irql.github/plugins/azure-kusto-graph-skills/skills/azure-kusto-irql/SKILL.md
- azure-local-multi-rack.github/plugins/azure-local-skills/skills/azure-local-multi-rack/SKILL.md
- azure-local.github/plugins/azure-local-skills/skills/azure-local/SKILL.md
- azure-ai-agents-persistent-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-ai-agents-persistent-dotnet/SKILL.md
- azure-ai-document-intelligence-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-ai-document-intelligence-dotnet/SKILL.md
- azure-ai-openai-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-ai-openai-dotnet/SKILL.md
- azure-ai-projects-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-ai-projects-dotnet/SKILL.md
- azure-ai-voicelive-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md
- azure-eventgrid-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-eventgrid-dotnet/SKILL.md
- azure-eventhub-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-eventhub-dotnet/SKILL.md
- azure-identity-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-identity-dotnet/SKILL.md
- azure-maps-search-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-maps-search-dotnet/SKILL.md
- azure-mgmt-apicenter-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-apicenter-dotnet/SKILL.md
- azure-mgmt-apimanagement-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-apimanagement-dotnet/SKILL.md
- azure-mgmt-applicationinsights-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-applicationinsights-dotnet/SKILL.md
- azure-mgmt-arizeaiobservabilityeval-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-arizeaiobservabilityeval-dotnet/SKILL.md
- azure-mgmt-botservice-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-botservice-dotnet/SKILL.md
- azure-mgmt-fabric-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-fabric-dotnet/SKILL.md
- azure-mgmt-mongodbatlas-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-mongodbatlas-dotnet/SKILL.md
- azure-mgmt-weightsandbiases-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-weightsandbiases-dotnet/SKILL.md
- azure-resource-manager-cosmosdb-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-resource-manager-cosmosdb-dotnet/SKILL.md
- azure-resource-manager-durabletask-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-resource-manager-durabletask-dotnet/SKILL.md
- azure-resource-manager-mysql-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-resource-manager-mysql-dotnet/SKILL.md
- azure-resource-manager-playwright-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-resource-manager-playwright-dotnet/SKILL.md
- azure-resource-manager-postgresql-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-resource-manager-postgresql-dotnet/SKILL.md
- azure-resource-manager-redis-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-resource-manager-redis-dotnet/SKILL.md
- azure-resource-manager-sql-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-resource-manager-sql-dotnet/SKILL.md
- azure-search-documents-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-search-documents-dotnet/SKILL.md
- azure-security-keyvault-keys-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-security-keyvault-keys-dotnet/SKILL.md
- azure-servicebus-dotnet.github/plugins/azure-sdk-dotnet/skills/azure-servicebus-dotnet/SKILL.md
- m365-agents-dotnet.github/plugins/azure-sdk-dotnet/skills/m365-agents-dotnet/SKILL.md
- microsoft-azure-webjobs-extensions-authentication-events-dotnet.github/plugins/azure-sdk-dotnet/skills/microsoft-azure-webjobs-extensions-authentication-events-dotnet/SKILL.md
- azure-ai-agents-persistent-java.github/plugins/azure-sdk-java/skills/azure-ai-agents-persistent-java/SKILL.md
- azure-ai-anomalydetector-java.github/plugins/azure-sdk-java/skills/azure-ai-anomalydetector-java/SKILL.md
- azure-ai-contentsafety-java.github/plugins/azure-sdk-java/skills/azure-ai-contentsafety-java/SKILL.md
- azure-ai-formrecognizer-java.github/plugins/azure-sdk-java/skills/azure-ai-formrecognizer-java/SKILL.md
- azure-ai-vision-imageanalysis-java.github/plugins/azure-sdk-java/skills/azure-ai-vision-imageanalysis-java/SKILL.md
- azure-ai-voicelive-java.github/plugins/azure-sdk-java/skills/azure-ai-voicelive-java/SKILL.md
- azure-appconfiguration-java.github/plugins/azure-sdk-java/skills/azure-appconfiguration-java/SKILL.md
- azure-communication-callautomation-java.github/plugins/azure-sdk-java/skills/azure-communication-callautomation-java/SKILL.md
- azure-communication-callingserver-java.github/plugins/azure-sdk-java/skills/azure-communication-callingserver-java/SKILL.md
- azure-communication-chat-java.github/plugins/azure-sdk-java/skills/azure-communication-chat-java/SKILL.md
- azure-communication-common-java.github/plugins/azure-sdk-java/skills/azure-communication-common-java/SKILL.md
- azure-communication-sms-java.github/plugins/azure-sdk-java/skills/azure-communication-sms-java/SKILL.md
- azure-compute-batch-java.github/plugins/azure-sdk-java/skills/azure-compute-batch-java/SKILL.md
- azure-cosmos-java.github/plugins/azure-sdk-java/skills/azure-cosmos-java/SKILL.md
- azure-data-tables-java.github/plugins/azure-sdk-java/skills/azure-data-tables-java/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
Reports can't be read right now.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

