MicrosoftAgentsSKILL.mdVerified source

Agent Skill

Azure AI Projects for TypeScript

Build Foundry applications with project clients, agents, deployments, datasets, indexes, and evaluations.

azure-aifoundrytypescript

Skill specification

Declared by Microsoft in the package front matter. Trigger conditions are what the coding agent matches on before it loads the skill.

Azure AI Projects for TypeScript SKILL.md front matter fields
Skill nameazure-ai-projects-ts
Trigger conditionsBuild AI applications using Azure AI Projects SDK for JavaScript (@azure/ai-projects). Use when working with Foundry project clients, agents, connections, deployments, datasets, indexes, evaluations, or getting OpenAI clients.
Declared licenseMIT
Version1.0.0
AuthorMicrosoft
Package@azure/ai-projects

Install azure-ai-projects-ts

Agent Skills are a shared file format, but each client discovers them from a different directory. Copy the command for your agent, then start a new session so the skill is picked up.

Claude Code

.claude/skills/azure-ai-projects-ts/SKILL.md

Project skills are committed with the repo. Use the user directory for a personal install across every project.

Project install

mkdir -p .claude/skills/azure-ai-projects-ts && curl -fsSL 'https://raw.githubusercontent.com/microsoft/skills/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts/SKILL.md' -o .claude/skills/azure-ai-projects-ts/SKILL.md

Personal install

mkdir -p ~/.claude/skills/azure-ai-projects-ts && curl -fsSL 'https://raw.githubusercontent.com/microsoft/skills/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts/SKILL.md' -o ~/.claude/skills/azure-ai-projects-ts/SKILL.md

Codex

.agents/skills/azure-ai-projects-ts/SKILL.md

Codex reads `.agents/skills/` as its primary location, which is also the cross-platform default other clients honour.

Project install

mkdir -p .agents/skills/azure-ai-projects-ts && curl -fsSL 'https://raw.githubusercontent.com/microsoft/skills/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts/SKILL.md' -o .agents/skills/azure-ai-projects-ts/SKILL.md

Personal install

mkdir -p ~/.agents/skills/azure-ai-projects-ts && curl -fsSL 'https://raw.githubusercontent.com/microsoft/skills/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts/SKILL.md' -o ~/.agents/skills/azure-ai-projects-ts/SKILL.md

Cursor

.cursor/skills/azure-ai-projects-ts/SKILL.md

Cursor also loads `.agents/skills/`, `.claude/skills/`, and `.codex/skills/`, so one committed copy can serve several clients.

Project install

mkdir -p .cursor/skills/azure-ai-projects-ts && curl -fsSL 'https://raw.githubusercontent.com/microsoft/skills/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts/SKILL.md' -o .cursor/skills/azure-ai-projects-ts/SKILL.md

Personal install

mkdir -p ~/.cursor/skills/azure-ai-projects-ts && curl -fsSL 'https://raw.githubusercontent.com/microsoft/skills/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts/SKILL.md' -o ~/.cursor/skills/azure-ai-projects-ts/SKILL.md

Gemini CLI

.gemini/skills/azure-ai-projects-ts/SKILL.md

Gemini CLI reads `.agents/skills/` first when both directories exist.

Project install

mkdir -p .gemini/skills/azure-ai-projects-ts && curl -fsSL 'https://raw.githubusercontent.com/microsoft/skills/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts/SKILL.md' -o .gemini/skills/azure-ai-projects-ts/SKILL.md

Personal install

mkdir -p ~/.gemini/skills/azure-ai-projects-ts && curl -fsSL 'https://raw.githubusercontent.com/microsoft/skills/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts/SKILL.md' -o ~/.gemini/skills/azure-ai-projects-ts/SKILL.md

GitHub Copilot

.github/skills/azure-ai-projects-ts/SKILL.md

Copilot in VS Code discovers repository skills from `.github/skills/`.

Project install

mkdir -p .github/skills/azure-ai-projects-ts && curl -fsSL 'https://raw.githubusercontent.com/microsoft/skills/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts/SKILL.md' -o .github/skills/azure-ai-projects-ts/SKILL.md

Personal install

mkdir -p ~/.copilot/skills/azure-ai-projects-ts && curl -fsSL 'https://raw.githubusercontent.com/microsoft/skills/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts/SKILL.md' -o ~/.copilot/skills/azure-ai-projects-ts/SKILL.md

Published by Microsoft under MIT. Rendered from the package in github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-typescript/skills/azure-ai-projects-ts.

Azure AI Projects SDK for TypeScript

High-level SDK for Azure AI Foundry projects with agents, connections, deployments, and evaluations.

Installation

npm install @azure/ai-projects @azure/identity

For tracing:

npm install @azure/monitor-opentelemetry @opentelemetry/api

Environment Variables

AZURE_AI_PROJECT_ENDPOINT=https://<resource>.services.ai.azure.com/api/projects/<project>
MODEL_DEPLOYMENT_NAME=gpt-4o
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production

Authentication

import { AIProjectClient } from "@azure/ai-projects";
import { DefaultAzureCredential, ManagedIdentityCredential } from "@azure/identity";

// Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
const credential = new DefaultAzureCredential({requiredEnvVars: ["AZURE_TOKEN_CREDENTIALS"]});
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/javascript/api/overview/azure/identity-readme?view=azure-node-latest#credential-classes
// const credential = new ManagedIdentityCredential();

const client = new AIProjectClient(
  process.env.AZURE_AI_PROJECT_ENDPOINT!,
  credential
);

Operation Groups

GroupPurpose
client.agentsCreate and manage AI agents
client.connectionsList connected Azure resources
client.deploymentsList model deployments
client.datasetsUpload and manage datasets
client.indexesCreate and manage search indexes
client.evaluatorsManage evaluation metrics
client.memoryStoresManage agent memory

Getting OpenAI Client

const openAIClient = await client.getOpenAIClient();

// Use for responses
const response = await openAIClient.responses.create({
  model: "gpt-4o",
  input: "What is the capital of France?"
});

// Use for conversations
const conversation = await openAIClient.conversations.create({
  items: [{ type: "message", role: "user", content: "Hello!" }]
});

Agents

Create Agent

const agent = await client.agents.createVersion("my-agent", {
  kind: "prompt",
  model: "gpt-4o",
  instructions: "You are a helpful assistant."
});

Agent with Tools

// Code Interpreter
const agent = await client.agents.createVersion("code-agent", {
  kind: "prompt",
  model: "gpt-4o",
  instructions: "You can execute code.",
  tools: [{ type: "code_interpreter", container: { type: "auto" } }]
});

// File Search
const agent = await client.agents.createVersion("search-agent", {
  kind: "prompt",
  model: "gpt-4o",
  tools: [{ type: "file_search", vector_store_ids: [vectorStoreId] }]
});

// Web Search
const agent = await client.agents.createVersion("web-agent", {
  kind: "prompt",
  model: "gpt-4o",
  tools: [{
    type: "web_search_preview",
    user_location: { type: "approximate", country: "US", city: "Seattle" }
  }]
});

// Azure AI Search
const agent = await client.agents.createVersion("aisearch-agent", {
  kind: "prompt",
  model: "gpt-4o",
  tools: [{
    type: "azure_ai_search",
    azure_ai_search: {
      indexes: [{
        project_connection_id: connectionId,
        index_name: "my-index",
        query_type: "simple"
      }]
    }
  }]
});

// Function Tool
const agent = await client.agents.createVersion("func-agent", {
  kind: "prompt",
  model: "gpt-4o",
  tools: [{
    type: "function",
    function: {
      name: "get_weather",
      description: "Get weather for a location",
      strict: true,
      parameters: {
        type: "object",
        properties: { location: { type: "string" } },
        required: ["location"]
      }
    }
  }]
});

// MCP Tool
const agent = await client.agents.createVersion("mcp-agent", {
  kind: "prompt",
  model: "gpt-4o",
  tools: [{
    type: "mcp",
    server_label: "my-mcp",
    server_url: "https://mcp-server.example.com",
    require_approval: "always"
  }]
});

Run Agent

const openAIClient = await client.getOpenAIClient();

// Create conversation
const conversation = await openAIClient.conversations.create({
  items: [{ type: "message", role: "user", content: "Hello!" }]
});

// Generate response using agent
const response = await openAIClient.responses.create(
  { conversation: conversation.id },
  { body: { agent: { name: agent.name, type: "agent_reference" } } }
);

// Cleanup
await openAIClient.conversations.delete(conversation.id);
await client.agents.deleteVersion(agent.name, agent.version);

Connections

// List all connections
for await (const conn of client.connections.list()) {
  console.log(conn.name, conn.type);
}

// Get connection by name
const conn = await client.connections.get("my-connection");

// Get connection with credentials
const connWithCreds = await client.connections.getWithCredentials("my-connection");

// Get default connection by type
const defaultAzureOpenAI = await client.connections.getDefault("AzureOpenAI", true);

Deployments

// List all deployments
for await (const deployment of client.deployments.list()) {
  if (deployment.type === "ModelDeployment") {
    console.log(deployment.name, deployment.modelName);
  }
}

// Filter by publisher
for await (const d of client.deployments.list({ modelPublisher: "OpenAI" })) {
  console.log(d.name);
}

// Get specific deployment
const deployment = await client.deployments.get("gpt-4o");

Datasets

// Upload single file
const dataset = await client.datasets.uploadFile(
  "my-dataset",
  "1.0",
  "./data/training.jsonl"
);

// Upload folder
const dataset = await client.datasets.uploadFolder(
  "my-dataset",
  "2.0",
  "./data/documents/"
);

// Get dataset
const ds = await client.datasets.get("my-dataset", "1.0");

// List versions
for await (const version of client.datasets.listVersions("my-dataset")) {
  console.log(version);
}

// Delete
await client.datasets.delete("my-dataset", "1.0");

Indexes

import { AzureAISearchIndex } from "@azure/ai-projects";

const indexConfig: AzureAISearchIndex = {
  name: "my-index",
  type: "AzureSearch",
  version: "1",
  indexName: "my-index",
  connectionName: "search-connection"
};

// Create index
const index = await client.indexes.createOrUpdate("my-index", "1", indexConfig);

// List indexes
for await (const idx of client.indexes.list()) {
  console.log(idx.name);
}

// Delete
await client.indexes.delete("my-index", "1");

Key Types

import {
  AIProjectClient,
  AIProjectClientOptionalParams,
  Connection,
  ModelDeployment,
  DatasetVersionUnion,
  AzureAISearchIndex
} from "@azure/ai-projects";

Best Practices

  1. Use getOpenAIClient() - For responses, conversations, files, and vector stores
  2. Version your agents - Use createVersion for reproducible agent definitions
  3. Clean up resources - Delete agents, conversations when done
  4. Use connections - Get credentials from project connections, don't hardcode
  5. Filter deployments - Use modelPublisher filter to find specific models

Add the registry badge

Maintainers can link this listing from the skill's own README. Free, no account needed, and it points back at the rendered package for anyone browsing the repo.

Markdown

[![Azure AI Projects for TypeScript on tokens&](https://tokensand.com/api/badges/skill/microsoft-azure-ai-projects-ts)](https://tokensand.com/agent-skills/microsoft-azure-ai-projects-ts)

HTML

<a href="https://tokensand.com/agent-skills/microsoft-azure-ai-projects-ts" target="_blank" rel="noopener">
  <img src="https://tokensand.com/api/badges/skill/microsoft-azure-ai-projects-ts" alt="Azure AI Projects for TypeScript on tokens&" />
</a>

More Microsoft Agent Skills

All Agent Skills