Generated banner for Azure AI Transcription Py
Generated logo for Azure AI Transcription Py

Azure AI Transcription Py

MicrosoftOfficialCreated by Microsoft

  • Skill
  • Tool integration
  • Automation and integrations
  • MIT
  • Low risk

From the author

Azure AI Transcription SDK for Python. Use for real-time and batch speech-to-text transcription with timestamps and diarization. Triggers: "transcription", "speech to text", "Azure AI Transcription", "TranscriptionClient".
— the description by Microsoft

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The azure-ai-transcription-py skill provides a Python client library for interacting with Azure AI Transcription services. It supports both batch processing for stored audio files and real-time streaming transcription. The SDK includes features for speaker diarization, timestamp generation, and management of transcription jobs, including listing, polling, and deleting resources.

What it does

  • Perform batch speech-to-text transcription for audio files stored in cloud storage.
  • Execute real-time streaming transcription for live audio input.
  • Enable speaker diarization to distinguish between multiple speakers.
  • Manage transcription lifecycle including listing, polling status, and deleting jobs.
  • Configure custom retry policies for transient network failures.
  • Support both key-based and token-based authentication via Azure Identity.

When to use it

  • When building applications that require automated speech-to-text conversion.
  • When processing long audio files from storage in a batch workflow.
  • When implementing real-time transcription features in live audio applications.
  • When you need to identify individual speakers within an audio recording.

Advantages

  • Provides both synchronous and asynchronous client implementations.
  • Supports robust resource management through context managers.
  • Offers granular control over long-running operations and polling.
  • Integrates with standard Azure authentication patterns.

Usage examples

“How do I start a batch transcription job for an audio file?”
The agent provides a code snippet using TranscriptionClient.begin_transcription, specifying the audio URL, locale, and enabling diarization.
“Show me how to perform real-time transcription in Python.”
The agent demonstrates using the begin_stream_transcription method to open a stream and process audio data in real-time.
“How can I clean up my completed transcription jobs?”
The agent provides a script that iterates through existing transcriptions and calls delete_transcription for those with a Succeeded status.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/microsoft/azure-ai-transcription-py/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip azure-ai-transcription-py.zip -d .agents/skills

Documentation by Microsoft

Azure AI Transcription SDK for Python

Client library for Azure AI Transcription (speech-to-text) with real-time and batch transcription.

Installation

pip install azure-ai-transcription

Environment Variables

TRANSCRIPTION_ENDPOINT=https://<resource>.cognitiveservices.azure.com
TRANSCRIPTION_KEY=<your-key>  # For key auth; not needed when using DefaultAzureCredential/TokenCredential

Authentication & Lifecycle

🔑 Two rules apply to every code sample below:

  1. Two auth modes are supported: AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]) for key-based auth, or DefaultAzureCredential() / any TokenCredential for Entra ID. Prefer DefaultAzureCredential in production; never hardcode credentials in code.

  2. Wrap every client in a context manager so HTTP transports and sockets are released deterministically:

    • Sync: with <Client>(...) as client:

    • Async: async with <Client>(...) as client:

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

Use subscription key authentication:

import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription import TranscriptionClient

with TranscriptionClient(
    endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
) as client:
    transcriptions = list(client.list_transcriptions())

Transcription (Batch)

import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription import TranscriptionClient

with TranscriptionClient(
    endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
) as client:
    job = client.begin_transcription(
        name="meeting-transcription",
        locale="en-US",
        content_urls=["https://<storage>/audio.wav"],
        diarization_enabled=True,
    )
    result = job.result()
    print(result.status)

Transcription (Real-time)

import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription import TranscriptionClient

with TranscriptionClient(
    endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
) as client:
    stream = client.begin_stream_transcription(locale="en-US")
    stream.send_audio_file("audio.wav")
    for event in stream:
        print(event.text)

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. Enable diarization when multiple speakers are present

  4. Use batch transcription for long files stored in blob storage

  5. Capture timestamps for subtitle generation

  6. Specify language to improve recognition accuracy

  7. Handle streaming backpressure for real-time transcription

  8. Close transcription sessions when complete

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.

Files

references/non-hero-scenarios.md

azure-ai-transcription-py non-hero scenarios

These scenarios are intentionally separate from hero flows in SKILL.md. They cover secondary/advanced patterns typically used after the primary end-to-end path is working.

Operational hardening

Retry Policy

Configure retries for transient failures via azure-core retry policy:

import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription import TranscriptionClient
from azure.core.pipeline.policies import RetryPolicy

retry_policy = RetryPolicy(retry_total=3, retry_backoff_factor=2)

with TranscriptionClient(
    endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
    retry_policy=retry_policy,
) as client:
    job = client.begin_transcription(
        name="meeting-transcription",
        locale="en-US",
        content_urls=["https://<storage>/audio.wav"],
    )
    result = job.result()
LRO Poll with Timeout

Avoid blocking indefinitely on long-running batch jobs:

import os
import time
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription import TranscriptionClient

with TranscriptionClient(
    endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
) as client:
    job = client.begin_transcription(
        name="long-audio",
        locale="en-US",
        content_urls=["https://<storage>/long-audio.wav"],
    )
    # Poll with an explicit deadline; job.result() does not raise on timeout
    deadline = time.monotonic() + 300
    while not job.done():
        if time.monotonic() > deadline:
            raise TimeoutError("Transcription did not complete within 300 s")
        time.sleep(5)
    result = job.result()
    print(result.status)
List and Paginate Transcriptions

list_transcriptions() returns a lazy iterator; paginate explicitly to avoid loading everything at once:

import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription import TranscriptionClient

with TranscriptionClient(
    endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
) as client:
    for index, transcription in enumerate(client.list_transcriptions()):
        print(f"[{index}] {transcription.name}: {transcription.status}")
Delete Completed Transcriptions

Remove completed jobs to keep the account tidy:

import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription import TranscriptionClient

with TranscriptionClient(
    endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
) as client:
    for transcription in client.list_transcriptions():
        if transcription.status == "Succeeded":
            client.delete_transcription(transcription.transcription_id)
Async Batch Transcription

Use the async client for non-blocking workflows:

import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription.aio import TranscriptionClient

async def run_async_transcription():
    async with TranscriptionClient(
        endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
        credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
    ) as client:
        job = await client.begin_transcription(
            name="async-meeting",
            locale="en-US",
            content_urls=["https://<storage>/audio.wav"],
            diarization_enabled=True,
        )
        result = await job.result()
        print(result.status)

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Python

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Microsoft
Publisher
Microsoft (Official)
Source
microsoft/skills · .github/plugins/azure-sdk-python/skills/azure-ai-transcription-py · commit 0696600
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Microsoft.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download azure-ai-transcription-py.zip