Skip to main content
skill

azure-ai-projects-java — Claude Code skill: overview and setup

Equips your agent with Java SDK patterns for Azure AI Foundry, covering search index creation, connection listing, and model evaluations.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add microsoft/skills --skill azure-ai-projects-java -a claude-code
Open on GitHub

What azure-ai-projects-java does

This skill supplies code patterns for the com.azure:azure-ai-projects package at version 1.0.0-beta.1. It guides the assistant through configuring AIProjectClientBuilder and spawning sub-clients. Core covered components include ConnectionsClient, IndexesClient, and EvaluationsClient.

Authentication relies on DefaultAzureCredentialBuilder or ManagedIdentityCredentialBuilder. Without the PROJECT_ENDPOINT environment variable, project setup fails immediately. Production deployments using default credentials also demand the AZURE_TOKEN_CREDENTIALS flag.

Listing operations return a PagedIterable stream. You must handle pagination explicitly. For assessment workflows, the library bridges directly into OpenAI's EvalService via evaluationsClient.getOpenAIClient(). Common failures surface as ResourceNotFoundException or HttpResponseException.

What it helps with

  • configure authentication using DefaultAzureCredentialBuilder
  • create or update Azure AI Search indexes in Java
  • list connected cloud resources through ConnectionsClient
  • run model evaluations with OpenAI EvalService

Example prompts for the agent

  • Show me how to configure AIProjectClientBuilder with production credentials in Java.
  • Write Java code to create an Azure AI Search index using IndexesClient.
  • How do I list connected project resources with ConnectionsClient in Java?

How to install azure-ai-projects-java

1Skills CLI (Vercel)

npx skills add microsoft/skills --skill azure-ai-projects-java -a claude-code

2Manually: put the files in place

~/.claude/skills/azure-ai-projects-java/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/azure-ai-projects-java/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about azure-ai-projects-java

How do I install azure-ai-projects-java in Claude Code?

Run npx skills add microsoft/skills --skill azure-ai-projects-java -a claude-code. This registers the skill for Claude Code.

What does the azure-ai-projects-java skill do?

It supplies ready-to-use patterns for the Azure AI Projects Java SDK. The skill assists in building client instances, configuring credentials, and orchestrating search indexes or datasets.

Which environment variables are required for the SDK?

You must provide PROJECT_ENDPOINT pointing to your project service URL. When running DefaultAzureCredential in production environments, set AZURE_TOKEN_CREDENTIALS as well.

Source text

SKILL.md · MIT
---
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 |

© Microsoft · MIT · microsoft/skills

Similar skills

All skills for Cloud: AWS, Azure, GCP →

From the same set242

The whole set →
azure-communication-callautomation-java Java SDK skill for Azure Communication Services Call Automation: outbound calls, IVR, recording, DTMF and speech recognition. ★ 3,149repo stars azure-appconfiguration-java Guides Java development with Azure App Configuration, covering client setup, key-value settings, label filtering, and ETag conditional updates. ★ 3,149repo stars azure-ai-voicelive-java This skill guides Java projects using Azure AI VoiceLive for two-way voice conversations over WebSocket. Use it when wiring audio streams and session events into an assistant. ★ 3,149repo stars azure-ai-vision-imageanalysis-java A skill for the Azure AI Vision SDK for Java. It feeds the agent ready code for captions, OCR, object detection, tagging and smart cropping. ★ 3,149repo stars azure-ai-formrecognizer-java This skill guides Java work with Azure AI Document Intelligence, from extracting document text and tables to analyzing invoices and receipts. ★ 3,149repo stars azure-ai-contentsafety-java A skill that walks the agent through the Azure AI Content Safety SDK for Java: text and image analysis, blocklists, harm detection. ★ 3,149repo stars azure-ai-anomalydetector-java Guides assistants in writing Java code with the Azure AI Anomaly Detector SDK. Useful for streaming metric checks and multivariate time-series analysis. ★ 3,149repo stars azure-ai-agents-persistent-java This skill guides Java projects using Azure AI Agents Persistent: create agents, manage message threads, and run agents. Useful when building persistent agents on Azure. ★ 3,149repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor