Azure Web PubSub Service SDK for Python
Build real-time apps with Azure Web PubSub
Real-time communication is hard to scale. This skill helps you implement WebSocket-based pub/sub messaging using Azure Web PubSub Service.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "Azure Web PubSub Service SDK for Python". Generate a client access token for user 'user123' with group membership
Expected outcome:
Token generated with URL endpoint and user ID. User is assigned to groups 'group1' and 'group2' with sendToGroup and joinLeaveGroup roles.
Using "Azure Web PubSub Service SDK for Python". Send a notification to all connected clients
Expected outcome:
Message broadcast successfully to all connections in the hub. Content type set to application/json with notification payload.
Security Audit
SafeThis is a documentation-only skill providing usage examples for the Azure Web PubSub Service SDK. No executable code is present. The skill references network operations and environment variable access as part of legitimate Azure SDK usage patterns. Static analysis found no security issues. The skill is safe to publish.
Risk Factors
🌐 Network access
🔑 Env variables
Quality Score
What You Can Build
Live chat application
Build a real-time chat system where users can send and receive messages instantly through WebSocket connections.
Real-time dashboard updates
Push live data updates to connected dashboard clients without polling, using group-based message routing.
Multiplayer game networking
Enable low-latency communication between game clients using WebSocket connections with user-based targeting.
Try These Prompts
Help me set up the Azure Web PubSub Service client in Python using a connection string. I need to send messages to all connected clients.
Generate a client access token for user 'alice' with permissions to join groups and send messages. Use Azure Entra ID authentication.
Show me how to add users to groups and send targeted messages to specific groups in Azure Web PubSub.
Create an async function that broadcasts a JSON message to all connections and handles graceful shutdown of the client and credentials.
Best Practices
- Use roles to limit client permissions and follow the principle of least privilege
- Generate short-lived tokens and implement token refresh mechanisms for security
- Use group-based messaging for efficient targeted communication instead of broadcasting
Avoid
- Using connection strings in source code instead of environment variables or Key Vault
- Granting full permissions to all clients without role-based access control
- Not handling connection failures or implementing reconnection logic in clients