Official agent skill

Azure Messaging Webpubsubservice Py

by microsoft in microsoft/skills

Azure Web PubSub Service SDK for Python. An agent skill from microsoft/skills.

OfficialMITAuto-check passedBackend & APIs

Install Azure Messaging Webpubsubservice Py

skills CLI
$ npx skills add microsoft/skills --skill azure-messaging-webpubsubservice-py -a claude-code

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

GitHub CLI
$ gh skill install microsoft/skills azure-messaging-webpubsubservice-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-messaging-webpubsubservice-py .claude/skills/azure-messaging-webpubsubservice-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-messaging-webpubsubservice-py
GitHub stars
3.1k
Used in
5 other repos
Token cost
~2k tokens
SKILL.md length
370 words
Files
3 (incl. references)
Skills in repo
150
Repo updated
First seen
Licence
MIT

At a glance

Azure Web PubSub Service SDK for Python. An agent skill from microsoft/skills.

  • Works in 10 steps: Pick sync OR async and stay consistent.… → Always use context managers for clients… → Use DefaultAzureCredential for portable… → …
  • Real-time messaging
  • SKILL.md covers Installation, Environment Variables, Authentication & Lifecycle and Service Client (Server-Side), plus 5 more sections
  • Calls pip; reaches learn.microsoft.com; needs AZURE_TOKEN_CREDENTIALS

What it does

Azure Messaging Webpubsubservice Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure Web PubSub Service SDK for Python. Use for real-time messaging, WebSocket connections, and pub/sub patterns. Triggers: "azure-messaging-webpubsubservice", "WebPubSubServiceClient", "real-time", "WebSocket", "pub/sub".

Its SKILL.md is about 2k 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 Backend & APIs, covering Realtime and WebSockets and Event-driven systems. It works with Microsoft Azure, Python, Azure Web PubSub and Visual Studio Code. 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

  • Real-time messaging
  • WebSocket connections
  • Pub/sub patterns

Example prompts

  • “azure-messaging-webpubsubservice”
  • “WebPubSubServiceClient”
  • “real-time”
  • “/azure-messaging-webpubsubservice-py”

Requirements

  • Python 3

Workflow steps

10 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 DefaultAzureCredential for portable auth across local dev and Azure (avoid connection strings / access keys when possible).
  4. Use roles to limit client permissions
  5. Use groups for targeted messaging
  6. Generate short-lived tokens for security
  7. Use user IDs to send to users across connections
  8. Handle reconnection in client applications
  9. Use JSON content type for structured data
  10. Close connections gracefully with reasons

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

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

Context cost

Azure Messaging Webpubsubservice Py loads about 2k tokens when it runs, and up to ~3.2k if it reads all its reference files. Until then it costs about 65 tokens; SKILL.md has 370 words of instructions outside code blocks.

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

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). 370 words, ~2,026 tokens.

Download SKILL.mdSave it as .claude/skills/azure-messaging-webpubsubservice-py/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
azure-messaging-webpubsubservice-py
description
Azure Web PubSub Service SDK for Python. Use for real-time messaging, WebSocket connections, and pub/sub patterns. Triggers: "azure-messaging-webpubsubservice", "WebPubSubServiceClient", "real-time", "WebSocket", "pub/sub".
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0
metadata.package
azure-messaging-webpubsubservice

Azure Web PubSub Service SDK for Python

Real-time messaging with WebSocket connections at scale.

Installation

bash
# Service SDK (server-side)
pip install azure-messaging-webpubsubservice

# Client SDK (for Python WebSocket clients)
pip install azure-messaging-webpubsubclient

Environment Variables

bash
AZURE_WEBPUBSUB_HUB=my-hub  # Required for all auth methods
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production

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.

Service Client (Server-Side)

Authentication
python
from azure.messaging.webpubsubservice import WebPubSubServiceClient
from azure.identity import DefaultAzureCredential, ManagedIdentityCredential

# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
credential = DefaultAzureCredential(require_envvar=True)
# 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 WebPubSubServiceClient(
    endpoint="https://<name>.webpubsub.azure.com",
    hub="my-hub",
    credential=credential
) as client:
    # Use `client` for all subsequent operations (see examples below)
    ...
Generate Client Access Token
python
# Token for anonymous user
token = client.get_client_access_token()
print(f"URL: {token['url']}")

# Token with user ID
token = client.get_client_access_token(
    user_id="user123",
    roles=["webpubsub.sendToGroup", "webpubsub.joinLeaveGroup"]
)

# Token with groups
token = client.get_client_access_token(
    user_id="user123",
    groups=["group1", "group2"]
)
Send to All Clients
python
# Send text
client.send_to_all(message="Hello everyone!", content_type="text/plain")

# Send JSON
client.send_to_all(
    message={"type": "notification", "data": "Hello"},
    content_type="application/json"
)
Send to User
python
client.send_to_user(
    user_id="user123",
    message="Hello user!",
    content_type="text/plain"
)
Send to Group
python
client.send_to_group(
    group="my-group",
    message="Hello group!",
    content_type="text/plain"
)
Send to Connection
python
client.send_to_connection(
    connection_id="abc123",
    message="Hello connection!",
    content_type="text/plain"
)
Group Management
python
# Add user to group
client.add_user_to_group(group="my-group", user_id="user123")

# Remove user from group
client.remove_user_from_group(group="my-group", user_id="user123")

# Add connection to group
client.add_connection_to_group(group="my-group", connection_id="abc123")

# Remove connection from group
client.remove_connection_from_group(group="my-group", connection_id="abc123")
Connection Management
python
# Check if connection exists
exists = client.connection_exists(connection_id="abc123")

# Check if user has connections
exists = client.user_exists(user_id="user123")

# Check if group has connections
exists = client.group_exists(group="my-group")

# Close connection
client.close_connection(connection_id="abc123", reason="Session ended")

# Close all connections for user
client.close_all_connections(user_id="user123")
Grant/Revoke Permissions
python
from azure.messaging.webpubsubservice import WebPubSubServiceClient

# Grant permission
client.grant_permission(
    permission="joinLeaveGroup",
    connection_id="abc123",
    target_name="my-group"
)

# Revoke permission
client.revoke_permission(
    permission="joinLeaveGroup",
    connection_id="abc123",
    target_name="my-group"
)

# Check permission
has_permission = client.check_permission(
    permission="joinLeaveGroup",
    connection_id="abc123",
    target_name="my-group"
)

Client SDK (Python WebSocket Client)

python
from azure.messaging.webpubsubclient import WebPubSubClient

with WebPubSubClient(credential=token["url"]) as client:
    @client.on("connected")
    def on_connected(e):
        print(f"Connected: {e.connection_id}")

    @client.on("server-message")
    def on_message(e):
        print(f"Message: {e.data}")

    @client.on("group-message")
    def on_group_message(e):
        print(f"Group {e.group}: {e.data}")

    client.send_to_group("my-group", "Hello from Python!")

Async Service Client

python
from azure.messaging.webpubsubservice.aio import WebPubSubServiceClient
from azure.identity.aio import DefaultAzureCredential

async def broadcast():
    async with DefaultAzureCredential() as credential:
        async with WebPubSubServiceClient(
            endpoint="https://<name>.webpubsub.azure.com",
            hub="my-hub",
            credential=credential
        ) as client:
            await client.send_to_all("Hello async!", content_type="text/plain")

Client Operations

OperationDescription
get_client_access_tokenGenerate WebSocket connection URL
send_to_allBroadcast to all connections
send_to_userSend to specific user
send_to_groupSend to group members
send_to_connectionSend to specific connection
add_user_to_groupAdd user to group
remove_user_from_groupRemove user from group
close_connectionDisconnect client
connection_existsCheck connection status
Show full SKILL.md (160 more words)Show less

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 DefaultAzureCredential for portable auth across local dev and Azure (avoid connection strings / access keys when possible).
  4. Use roles to limit client permissions
  5. Use groups for targeted messaging
  6. Generate short-lived tokens for security
  7. Use user IDs to send to users across connections
  8. Handle reconnection in client applications
  9. Use JSON content type for structured data
  10. Close connections gracefully with reasons

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-messaging-webpubsubservice-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 Messaging Webpubsubservice 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 Messaging Webpubsubservice Py compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure Messaging Webpubsubservice Py this skillmicrosoft/skills3.1k5 repos~2kAutomated safety check: PassMIT
Cryptofeed2025Emma/vibe-coding-cn23k1 repos~1.6kAutomated safety check: PassMIT
Azure Web Pubsub TSaiskillstore/marketplace4304 repos~2kAutomated safety check: PassNone
Groq Webhooks Eventsjeremylongshore/tons-of-skills-marketplace2.8k—~1.7kAutomated safety check: PassMIT
Ak Cloud Deployyaalalabs/agent-kernel192—~14kAutomated safety check: PassApache-2.0
Azure Web PubsubMicrosoftDocs/Agent-Skills777—~4.2kAutomated safety check: PassCC-BY-4.0

Similar skills

  • Cryptofeed

    2025Emma/vibe-coding-cn

    Cryptofeed - Real-time cryptocurrency market data feeds from 40+ exchanges.

    23k GitHub starsUsed in 1 repo~1.6k tokens
    Backend & APIsAuto-check passed
  • Azure Web Pubsub TS

    aiskillstore/marketplace

    Real-time messaging with WebSocket connections and pub/sub patterns.

    430 GitHub starsUsed in 4 repos~2k tokens
    Backend & APIsAuto-check passed
  • Groq Webhooks Events

    jeremylongshore/tons-of-skills-marketplace

    Build event-driven architectures with Groq streaming, batch processing, and async patterns.

    2.8k GitHub stars~1.7k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Ak Cloud Deploy

    yaalalabs/agent-kernel

    Deploy an Agent Kernel project to AWS, Azure, or GCP using Terraform modules, or to any Kubernetes cluster (on-prem, baremetal, EKS) using the official Helm chart.

    192 GitHub stars~14k tokensUpdated today
    Backend & APIsAuto-check passed
  • Azure Web Pubsub

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Web PubSub development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations &…

    777 GitHub stars~4.2k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Azure Event Hubs

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Event Hubs development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations &…

    777 GitHub stars~3.8k tokensUpdated 4 days ago
    DevelopmentAuto-check passed

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

Categories

Questions about Azure Messaging Webpubsubservice Py

What does Azure Messaging Webpubsubservice Py do?

Azure Web PubSub Service SDK for Python. An agent skill from microsoft/skills. Azure Messaging Webpubsubservice Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure Web PubSub Service SDK for Python.

When should I use Azure Messaging Webpubsubservice Py?

Azure Messaging Webpubsubservice Py fits situations like: real-time messaging; webSocket connections; pub/sub patterns.

How do I install Azure Messaging Webpubsubservice Py in Claude Code?

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

How do I install Azure Messaging Webpubsubservice Py in Codex?

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

Can I use Azure Messaging Webpubsubservice 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-messaging-webpubsubservice-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-messaging-webpubsubservice-py, .gemini/skills/azure-messaging-webpubsubservice-py, .github/skills/azure-messaging-webpubsubservice-py and .opencode/skills/azure-messaging-webpubsubservice-py in your project.

What does Azure Messaging Webpubsubservice Py need to run?

Going by SKILL.md and its folder, Azure Messaging Webpubsubservice Py needs the command-line tools its instructions call (pip) and credentials named AZURE_TOKEN_CREDENTIALS. Our summary lists: Python 3.

Does Azure Messaging Webpubsubservice 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 Messaging Webpubsubservice 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 Messaging Webpubsubservice Py use?

Azure Messaging Webpubsubservice 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 Messaging Webpubsubservice Py use?

About 2k tokens (SKILL.md is roughly 8.1k 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.2k tokens, read only when the agent opens those files.

What are the alternatives to Azure Messaging Webpubsubservice Py?

Skills that share tags, products or a category with Azure Messaging Webpubsubservice Py: Cryptofeed (2025Emma/vibe-coding-cn, 23k stars), Azure Web Pubsub TS (aiskillstore/marketplace, 430 stars), Groq Webhooks Events (jeremylongshore/tons-of-skills-marketplace, 2.8k stars) and Ak Cloud Deploy (yaalalabs/agent-kernel, 192 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure Messaging Webpubsubservice 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.