Official agent skill

Azure AI Translation Document Py

by microsoft in microsoft/skills

Azure AI Document Translation SDK for batch translation of documents with format preservation.

OfficialMITAuto-check passedDocuments & Office

Install Azure AI Translation Document Py

skills CLI
$ npx skills add microsoft/skills --skill azure-ai-translation-document-py -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/skills azure-ai-translation-document-py --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/plugins/azure-sdk-python/skills/azure-ai-translation-document-py .claude/skills/azure-ai-translation-document-py && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
azure-ai-translation-document-py
GitHub stars
3.1k
Used in
5 other repos
Token cost
~2.6k tokens
SKILL.md length
390 words
Files
3 (incl. references)
Skills in repo
150
Repo updated
First seen
Licence
MIT

At a glance

Azure AI Document Translation SDK for batch translation of documents with format preservation.

  • Works in 9 steps: Pick sync OR async and stay consistent.… → Always use context managers for clients… → Use SAS tokens with minimal required… → …
  • Translating Word
  • SKILL.md covers Installation, Environment Variables, Authentication & Lifecycle and Basic Document Translation, plus 13 more sections
  • Calls pip; reaches learn.microsoft.com; needs AZURE_TOKEN_CREDENTIALS and AZURE_DOCUMENT_TRANSLATION_KEY

What it does

Azure AI Translation Document Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure AI Document Translation SDK for batch translation of documents with format preservation. Use for translating Word, PDF, Excel, PowerPoint, and other document formats at scale. Triggers: "document translation", "batch translation", "translate documents", "DocumentTranslationClient".

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/capabilities.md` and `references/non-hero-scenarios.md`).

It sits in Documents & Office, covering Translation. It works with Microsoft Azure, Microsoft Excel, Microsoft PowerPoint and Azure AI Translator. The repository describes itself as: Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents. The licence is MIT.

When your agent uses it

  • Translating Word
  • Other document formats at scale

Example prompts

  • “document translation”
  • “batch translation”
  • “translate documents”
  • “/azure-ai-translation-document-py”

Requirements

  • Python 3
  • A credential in AZURE_DOCUMENT_TRANSLATION_KEY

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Pick sync OR async and stay consistent. Do not mix azure.xxx sync clients with azure.xxx.aio async clients in the same call path. Choose…
  2. Always use context managers for clients and async credentials. Wrap every client in with Client(...) as client: (sync) or async with…
  3. Use SAS tokens with minimal required permissions
  4. Monitor long-running operations with poller.status()
  5. Handle document-level errors by iterating document statuses
  6. Use glossaries for domain-specific terminology
  7. Separate target containers for each language
  8. Use async client for multiple concurrent jobs
  9. Check supported formats before submitting documents

What it can do on your machine

Read from SKILL.md and the folder at commit 3898ec8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • learn.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AZURE_TOKEN_CREDENTIALS
    • AZURE_DOCUMENT_TRANSLATION_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Azure AI Translation Document Py loads about 2.6k tokens when it runs, and up to ~4k if it reads all its reference files. Until then it costs about 80 tokens; SKILL.md has 390 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/skills at commit 3898ec8, republished under its MIT licence (© microsoft). 390 words, ~2,627 tokens.

Download SKILL.mdSave it as .claude/skills/azure-ai-translation-document-py/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
azure-ai-translation-document-py
description
Azure AI Document Translation SDK for batch translation of documents with format preservation. Use for translating Word, PDF, Excel, PowerPoint, and other document formats at scale. Triggers: "document translation", "batch translation", "translate documents", "DocumentTranslationClient".
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0
metadata.package
azure-ai-translation-document

Azure AI Document Translation SDK for Python

Client library for Azure AI Translator document translation service for batch document translation with format preservation.

Installation

bash
pip install azure-ai-translation-document

Environment Variables

bash
AZURE_DOCUMENT_TRANSLATION_ENDPOINT=https://<resource>.cognitiveservices.azure.com  # Required for all auth methods
# Storage for source and target documents
AZURE_SOURCE_CONTAINER_URL=https://<storage>.blob.core.windows.net/<container>?<sas>  # Required for all auth methods
AZURE_TARGET_CONTAINER_URL=https://<storage>.blob.core.windows.net/<container>?<sas>  # Required for all auth methods
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production
AZURE_DOCUMENT_TRANSLATION_KEY=<your-api-key>  # Only required for the legacy API-key auth path below

Authentication & Lifecycle

🔑 Two rules apply to every code sample below:

  1. Prefer DefaultAzureCredential. It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.
    • Local dev: DefaultAzureCredential works as-is.
    • Production: set AZURE_TOKEN_CREDENTIALS=prod (or AZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.
  2. Wrap every client in a context manager so HTTP transports, sockets, and token caches are released deterministically:
    • Sync: with <Client>(...) as client:
    • Async: async with <Client>(...) as client: and async with DefaultAzureCredential() as credential: (from azure.identity.aio)

Snippets may abbreviate this setup, but production code should always follow both rules.

python
import os
from azure.identity import DefaultAzureCredential, ManagedIdentityCredential
from azure.ai.translation.document import DocumentTranslationClient

# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
credential = DefaultAzureCredential()
# Or use a specific credential directly in production:
# See https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python#credential-classes
# credential = ManagedIdentityCredential()

with DocumentTranslationClient(
    endpoint=os.environ["AZURE_DOCUMENT_TRANSLATION_ENDPOINT"],
    credential=credential,
) as client:
    statuses = list(client.list_translation_statuses())
Legacy: API Key (existing keyed deployments)

New code should use DefaultAzureCredential above. Use AzureKeyCredential only if you have an existing keyed deployment that hasn't been migrated to Entra ID yet — for example, regulated environments still completing their Entra rollout.

python
import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.translation.document import DocumentTranslationClient, SingleDocumentTranslationClient

with DocumentTranslationClient(
    endpoint=os.environ["AZURE_DOCUMENT_TRANSLATION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["AZURE_DOCUMENT_TRANSLATION_KEY"]),
) as client:
    statuses = list(client.list_translation_statuses())

# SingleDocumentTranslationClient accepts the same key-based credential.

Basic Document Translation

python
import os
from azure.ai.translation.document import DocumentTranslationClient, DocumentTranslationInput, TranslationTarget
from azure.core.exceptions import HttpResponseError
from azure.identity import DefaultAzureCredential

credential = DefaultAzureCredential()

with DocumentTranslationClient(
    endpoint=os.environ["AZURE_DOCUMENT_TRANSLATION_ENDPOINT"],
    credential=credential,
) as client:
    source_url = os.environ["AZURE_SOURCE_CONTAINER_URL"]
    target_url = os.environ["AZURE_TARGET_CONTAINER_URL"]

    try:
        # Start translation job
        poller = client.begin_translation(
            inputs=[
                DocumentTranslationInput(
                    source_url=source_url,
                    targets=[
                        TranslationTarget(
                            target_url=target_url,
                            language="es"  # Translate to Spanish
                        )
                    ]
                )
            ]
        )

        # Wait for completion
        result = poller.result()

        print(f"Status: {poller.status()}")
        print(f"Documents translated: {poller.details.documents_succeeded_count}")
        print(f"Documents failed: {poller.details.documents_failed_count}")
    except HttpResponseError as e:
        print(f"Translation failed: {e.message}")
        raise

Multiple Target Languages

python
poller = client.begin_translation(
    inputs=[
        DocumentTranslationInput(
            source_url=source_url,
            targets=[
                TranslationTarget(target_url=target_url_es, language="es"),
                TranslationTarget(target_url=target_url_fr, language="fr"),
                TranslationTarget(target_url=target_url_de, language="de")
            ]
        )
    ]
)

Translate Single Document

python
from azure.ai.translation.document import SingleDocumentTranslationClient
from azure.identity import DefaultAzureCredential

with open("document.docx", "rb") as f:
    document_content = f.read()

with SingleDocumentTranslationClient(endpoint, DefaultAzureCredential()) as single_client:
    result = single_client.translate(
        body=document_content,
        target_language="es",
        content_type="application/vnd.openxmlformats-officedocument.wordprocessingml.document"
    )

# Save translated document
with open("document_es.docx", "wb") as f:
    f.write(result)

Check Translation Status

python
# Get all translation operations
operations = client.list_translation_statuses()

for op in operations:
    print(f"Operation ID: {op.id}")
    print(f"Status: {op.status}")
    print(f"Created: {op.created_on}")
    print(f"Total documents: {op.documents_total_count}")
    print(f"Succeeded: {op.documents_succeeded_count}")
    print(f"Failed: {op.documents_failed_count}")

List Document Statuses

python
# Get status of individual documents in a job
operation_id = poller.id
document_statuses = client.list_document_statuses(operation_id)

for doc in document_statuses:
    print(f"Document: {doc.source_document_url}")
    print(f"  Status: {doc.status}")
    print(f"  Translated to: {doc.translated_to}")
    if doc.error:
        print(f"  Error: {doc.error.message}")

Cancel Translation

python
# Cancel a running translation
client.cancel_translation(operation_id)

Using Glossary

python
from azure.ai.translation.document import TranslationGlossary

poller = client.begin_translation(
    inputs=[
        DocumentTranslationInput(
            source_url=source_url,
            targets=[
                TranslationTarget(
                    target_url=target_url,
                    language="es",
                    glossaries=[
                        TranslationGlossary(
                            glossary_url="https://<storage>.blob.core.windows.net/glossary/terms.csv?<sas>",
                            file_format="csv"
                        )
                    ]
                )
            ]
        )
    ]
)

Supported Document Formats

python
# Get supported formats
formats = client.get_supported_document_formats()

for fmt in formats:
    print(f"Format: {fmt.format}")
    print(f"  Extensions: {fmt.file_extensions}")
    print(f"  Content types: {fmt.content_types}")

Supported Languages

python
# Get supported languages
languages = client.get_supported_languages()

for lang in languages:
    print(f"Language: {lang.name} ({lang.code})")

Async Client

python
from azure.ai.translation.document.aio import DocumentTranslationClient
from azure.identity.aio import DefaultAzureCredential

async def translate_documents():
    async with DefaultAzureCredential() as credential:
        async with DocumentTranslationClient(
            endpoint=endpoint,
            credential=credential,
        ) as client:
            poller = await client.begin_translation(inputs=[...])
            result = await poller.result()

Supported Formats

CategoryFormats
DocumentsDOCX, PDF, PPTX, XLSX, HTML, TXT, RTF
StructuredCSV, TSV, JSON, XML
LocalizationXLIFF, XLF, MHTML
Show full SKILL.md (166 more words)Show less

Storage Requirements

  • Source and target containers must be Azure Blob Storage
  • Use SAS tokens with appropriate permissions:
    • Source: Read, List
    • Target: Write, List

Best Practices

  1. Pick sync OR async and stay consistent. Do not mix azure.xxx sync clients with azure.xxx.aio async clients in the same call path. Choose one mode per module.
  2. Always use context managers for clients and async credentials. Wrap every client in with Client(...) as client: (sync) or async with Client(...) as client: (async). For async DefaultAzureCredential from azure.identity.aio, also use async with credential: so tokens and transports are cleaned up.
  3. Use SAS tokens with minimal required permissions
  4. Monitor long-running operations with poller.status()
  5. Handle document-level errors by iterating document statuses
  6. Use glossaries for domain-specific terminology
  7. Separate target containers for each language
  8. Use async client for multiple concurrent jobs
  9. Check supported formats before submitting documents

Reference Files

FileContents
references/capabilities.mdAdditional non-hero capabilities, operation-group coverage, and production checklists.
references/non-hero-scenarios.mdDedicated non-hero examples for secondary/advanced scenarios.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .github/plugins/azure-sdk-python/skills/azure-ai-translation-document-py of microsoft/skills.

  • SKILL.md
  • references/capabilities.md
  • references/non-hero-scenarios.md

Open the folder on GitHubat commit 3898ec8

Used in 5 other repositories

We found 14 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in microsoft/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Azure AI Translation Document Py next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Azure AI Translation Document Py compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure AI Translation Document Py this skillmicrosoft/skills3.1k5 repos~2.6kAutomated safety check: PassMIT
Persian Writingali2000hos/persian-writing362—~4.4kAutomated safety check: WarnMIT
Azure Immersive ReaderMicrosoftDocs/Agent-Skills777—~1.4kAutomated safety check: PassCC-BY-4.0
Azure TranslatorMicrosoftDocs/Agent-Skills777—~4.4kAutomated safety check: PassCC-BY-4.0
Azure AI Translation Text Pyaiskillstore/marketplace4304 repos~1.9kAutomated safety check: PassNone
Forge Codegen Crudyaomindong1996/forge-admin125—~1.3kAutomated safety check: PassApache-2.0

Similar skills

  • Persian Writing

    ali2000hos/persian-writing

    Write natural, human-sounding Persian (Farsi) and build correct right-to-left Persian deliverables.

    362 GitHub stars~4.4k tokensUpdated 5 days ago
    Documents & OfficeAuto-check: warnings
  • Azure Immersive Reader

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure AI Immersive Reader development including best practices, limits & quotas, security, configuration, and integrations & coding patterns.

    777 GitHub stars~1.4k tokensUpdated 4 days ago
    Writing & ContentAuto-check passed
  • Azure Translator

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Translator development including troubleshooting, best practices, decision making, limits & quotas, security, configuration, integrations & coding patterns, and deployment.

    777 GitHub stars~4.4k tokensUpdated 4 days ago
    DevOps & CloudAuto-check passed
  • Azure AI Translation Text Py

    aiskillstore/marketplace

    Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup.

    430 GitHub starsUsed in 4 repos~1.9k tokens
    Writing & ContentAuto-check passed
  • Forge Codegen Crud

    yaomindong1996/forge-admin

    Generate or review Forge project code-generation output for CRUD modules.

    125 GitHub stars~1.3k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Markitdown

    ImCa0/just-laws

    Convert files and office documents to Markdown. An agent skill from ImCa0/just-laws.

    782 GitHub starsUsed in 14 repos~3.2k tokens
    Documents & OfficeAuto-check: notes

More from microsoft/skills

All 150 skills in this repo
  • Official

    Covers producer, consumer, and checkpoint-store setup for Azure Event Hubs streaming in Python, with Entra ID auth and partition targeting.

    3.1k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Official

    Builds podcast-style audio narration from text with Azure OpenAI's GPT Realtime Mini over WebSocket, from a Python FastAPI backend to a React player.

    3.1k GitHub starsUsed in 1 repo~947 tokens
    Auto-check passed
  • Frontend UI Dark TS

    microsoft/skills

    Official

    Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations.

    3.1k GitHub starsUsed in 5 repos~3.6k tokens
    Auto-check passed
  • Pydantic Models Py

    microsoft/skills

    Official

    Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

    3.1k GitHub starsUsed in 5 repos~496 tokens
    Auto-check passed
  • Official

    Reference for building on Microsoft Foundry with the azure-ai-projects Python SDK: project clients, versioned agents, evaluations, connections, datasets and indexes.

    3.1k GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed
  • Skill Creator

    microsoft/skills

    Official

    Guide for creating effective skills for AI coding agents working with Azure SDKs and Microsoft Foundry services.

    3.1k GitHub starsUsed in 5 repos~17k tokens
    Auto-check passed

Questions about Azure AI Translation Document Py

What does Azure AI Translation Document Py do?

Azure AI Document Translation SDK for batch translation of documents with format preservation. Azure AI Translation Document Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure AI Document Translation SDK for batch translation of documents with format preservation.

When should I use Azure AI Translation Document Py?

Azure AI Translation Document Py fits situations like: translating Word; other document formats at scale.

How do I install Azure AI Translation Document Py in Claude Code?

Run `npx skills add microsoft/skills --skill azure-ai-translation-document-py -a claude-code`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/azure-ai-translation-document-py in microsoft/skills) into .claude/skills/azure-ai-translation-document-py in your project. Claude Code loads it when a task matches its description.

How do I install Azure AI Translation Document Py in Codex?

Run `npx skills add microsoft/skills --skill azure-ai-translation-document-py -a codex`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/azure-ai-translation-document-py in microsoft/skills) into .agents/skills/azure-ai-translation-document-py in your project. Codex loads it when a task matches its description.

Can I use Azure AI Translation Document Py in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/skills --skill azure-ai-translation-document-py -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/azure-ai-translation-document-py, .gemini/skills/azure-ai-translation-document-py, .github/skills/azure-ai-translation-document-py and .opencode/skills/azure-ai-translation-document-py in your project.

What does Azure AI Translation Document Py need to run?

Going by SKILL.md and its folder, Azure AI Translation Document Py needs the command-line tools its instructions call (pip) and credentials named AZURE_TOKEN_CREDENTIALS and AZURE_DOCUMENT_TRANSLATION_KEY. Our summary lists: Python 3; A credential in AZURE_DOCUMENT_TRANSLATION_KEY.

Does Azure AI Translation Document Py access the network?

SKILL.md names 1 domain. In commands or code: learn.microsoft.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Azure AI Translation Document Py safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Azure AI Translation Document Py use?

Azure AI Translation Document Py is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Azure AI Translation Document Py use?

About 2.6k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.4k tokens, read only when the agent opens those files.

What are the alternatives to Azure AI Translation Document Py?

Skills that share tags, products or a category with Azure AI Translation Document Py: Persian Writing (ali2000hos/persian-writing, 362 stars), Azure Immersive Reader (MicrosoftDocs/Agent-Skills, 777 stars), Azure Translator (MicrosoftDocs/Agent-Skills, 777 stars) and Azure AI Translation Text Py (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure AI Translation Document Py?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,094 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 9, 2026.

Source: microsoft/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.