Azure Web PubSub for Python
Build Azure WebSocket messaging and publish-subscribe workflows for Python applications.
The documentation recommends DefaultAzureCredential, scoped roles, and short-lived tokens, and warns against logging bearer-token URLs, supporting least-privilege and sensitive-data awareness; however, anonymous-token examples, direct URL printing, message/connection-closing operations, and permission changes lack user confirmation, impact disclosure, or rollback guidance, so 10 points are deducted.
Sync and async lifecycles, retry configuration, and basic connection checks are documented, making the happy path understandable; however, there are no skill-specific tests or reproducible results, some operation/API names require external confirmation, and abnormal inputs, authorization failures, reconnection, and diagnostic feedback are thin, so 13 points are deducted.
Triggers, Python server/client roles, and sync/async scenarios are reasonably clear, with a main operation list; non-fit boundaries, input/output contracts, compatibility ranges, and mainland-China network reachability are not addressed, and the server/client scope may cause semantic ambiguity, so 6 points are deducted.
The skill uses layered installation, authentication, lifecycle, operations, and reference documentation, and includes MIT licensing, author, version 1.0.0, and a reference index; it lacks a changelog, explicit maintenance owner/update path, FAQ, pinned dependency versions, troubleshooting, and complete limitation disclosure, so 6 points are deducted.
It covers token generation, broadcast, user/group/connection operations, permissions, client usage, and async flows, providing directly useful coding patterns; nevertheless, static evidence cannot establish executability, several advanced examples have API/parameter consistency risks, and production error handling and safety require substantial supplementation, so 9 points are deducted.
Concrete code, an operation table, and repository-level CI/test materials provide limited auditability; there is no skill-specific committed test suite, third-party execution evidence, or revision-pinned API corroboration, so key paths cannot be independently reproduced from static evidence and 6 points are deducted.
- Client access-token URLs contain bearer credentials; do not print, log, or pass them through untrusted channels.
- Sending messages, closing connections, granting/revoking permissions, and issuing client tokens have external effects; add explicit confirmation, authorization boundaries, and recovery procedures before adoption.
- Verify advanced method names and parameters against the current SDK documentation; the reference uses WEBPUBSUB_ENDPOINT while the main document only declares AZURE_WEBPUBSUB_HUB, leaving the configuration contract incomplete.
- There is no evidence about mainland-China reachability, service-region availability, or offline alternatives.
What it does & when to use it
This skill guides developers through the Azure Web PubSub Service SDK for Python. It covers server-side broadcasting, targeted delivery, group and connection management, permissions, and client access tokens. It also includes the Python WebSocket client and asynchronous service-client patterns. The guidance favors DefaultAzureCredential and deterministic context-managed cleanup for clients and credentials.
Shows how to install the service and optional client packages; configure the Web PubSub hub and credential environment variables; create synchronous or asynchronous WebPubSubServiceClient instances; generate client access tokens; send text or JSON messages to all clients, users, groups, or individual connections; manage group membership and connections; check connection, user, group, and permission status; grant or revoke permissions; close connections; and use WebPubSubClient event handlers for connected, server-message, and group-message events.
- A Python backend developer broadcasting live notifications to connected clients.
- An application team delivering messages selectively to users, groups, or individual connections.
- A developer implementing group chat, live status updates, or publish-subscribe behavior on Azure.
- A team that needs consistent synchronous or asynchronous Python patterns for WebSocket connection management.
Pros & cons
- Covers server, client, and asynchronous client patterns.
- Provides concrete examples for broadcasting, targeted delivery, group management, connection management, and permissions.
- Recommends DefaultAzureCredential and explains production credential-chain constraints.
- Includes practical guidance on short-lived tokens, roles, user IDs, reconnection, JSON content, and graceful closure.
- Requires the Azure Web PubSub service and network connectivity; no local mock is documented.
- The source does not provide skill-specific test coverage or acceptance evidence.
- Resource provisioning, deployment, and full service configuration are outside the documented scope.
- No specific SDK version requirements are stated.
How to install
Run npx skills add microsoft/skills and select this skill in the installation wizard. Alternatively, run git clone https://github.com/microsoft/skills.git, then copy .github/plugins/azure-sdk-python/skills/azure-messaging-webpubsubservice-py into an agent skill directory such as your-project/.github/skills/. Install the runtime packages with pip install azure-messaging-webpubsubservice and, when using the Python WebSocket client, pip install azure-messaging-webpubsubclient.
How to use
In an Agent Skills-compatible coding agent, use a prompt such as: Use azure-messaging-webpubsubservice to implement group broadcasting for my Python service with DefaultAzureCredential and context managers. The documented trigger terms include azure-messaging-webpubsubservice, WebPubSubServiceClient, real-time, WebSocket, and pub/sub.