[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69AQJVAQRSGPCRCETNJN5VF":3,"skill-same:01M69AQJVAQRSGPCRCETNJN5VF":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M69AQJVAQRSGPCRCETNJN5VF","azure-messaging-webpubsub-java",null,"Build real-time web applications with Azure Web PubSub SDK for Java. Use when implementing WebSocket-based messaging, live updates, chat applications, or server-to-client push notifications.","microsoft\u002Fskills","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69AJYYW4E1RMSYCQDJ4FJSH",3199,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fazure-sdk-java\u002Fskills\u002Fazure-messaging-webpubsub-java\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,9,40],"azure messaging","azure","azure messaging webpubsub java","java","messaging","websocket","when","for","implementing","updates","pubsub","live","push notifications","time","use","applications","real-time","sdk","server","notifications","push","web","2026-11-10 10:12:30",false,"---\nname: azure-messaging-webpubsub-java\ndescription: Build real-time web applications with Azure Web PubSub SDK for Java. Use when implementing WebSocket-based messaging, live updates, chat applications, or server-to-client push notifications.\nlicense: MIT\nmetadata:\n  author: Microsoft\n  version: \"1.0.0\"\n  package: com.azure:azure-messaging-webpubsub\n---\n\n# Azure Web PubSub SDK for Java\n\nBuild real-time web applications using the Azure Web PubSub SDK for Java.\n\n## Installation\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>com.azure\u003C\u002FgroupId>\n    \u003CartifactId>azure-messaging-webpubsub\u003C\u002FartifactId>\n    \u003Cversion>1.5.0\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\n## Client Creation\n\n### With Connection String\n\n```java\nimport com.azure.messaging.webpubsub.WebPubSubServiceClient;\nimport com.azure.messaging.webpubsub.WebPubSubServiceClientBuilder;\n\nWebPubSubServiceClient client = new WebPubSubServiceClientBuilder()\n    .connectionString(\"\u003Cconnection-string>\")\n    .hub(\"chat\")\n    .buildClient();\n```\n\n### With Access Key\n\n```java\nimport com.azure.core.credential.AzureKeyCredential;\n\nWebPubSubServiceClient client = new WebPubSubServiceClientBuilder()\n    .credential(new AzureKeyCredential(\"\u003Caccess-key>\"))\n    .endpoint(\"\u003Cendpoint>\")\n    .hub(\"chat\")\n    .buildClient();\n```\n\n### With DefaultAzureCredential\n\n```java\nimport com.azure.core.credential.TokenCredential;\nimport com.azure.identity.AzureIdentityEnvVars;\nimport com.azure.identity.DefaultAzureCredentialBuilder;\nimport com.azure.identity.ManagedIdentityCredentialBuilder;\n\n\u002F\u002F Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\nTokenCredential credential = new DefaultAzureCredentialBuilder()\n    .requireEnvVars(AzureIdentityEnvVars.AZURE_TOKEN_CREDENTIALS)\n    .build();\n\u002F\u002F Or use a specific credential directly in production:\n\u002F\u002F See https:\u002F\u002Flearn.microsoft.com\u002Fjava\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-java-stable#credential-classes\n\u002F\u002F TokenCredential credential = new ManagedIdentityCredentialBuilder().build();\n\nWebPubSubServiceClient client = new WebPubSubServiceClientBuilder()\n    .credential(credential)\n    .endpoint(\"\u003Cendpoint>\")\n    .hub(\"chat\")\n    .buildClient();\n```\n\n### Async Client\n\n```java\nimport com.azure.messaging.webpubsub.WebPubSubServiceAsyncClient;\n\nWebPubSubServiceAsyncClient asyncClient = new WebPubSubServiceClientBuilder()\n    .connectionString(\"\u003Cconnection-string>\")\n    .hub(\"chat\")\n    .buildAsyncClient();\n```\n\n## Key Concepts\n\n- **Hub**: Logical isolation unit for connections\n- **Group**: Subset of connections within a hub\n- **Connection**: Individual WebSocket client connection\n- **User**: Entity that can have multiple connections\n\n## Core Patterns\n\n### Send to All Connections\n\n```java\nimport com.azure.messaging.webpubsub.models.WebPubSubContentType;\n\n\u002F\u002F Send text message\nclient.sendToAll(\"Hello everyone!\", WebPubSubContentType.TEXT_PLAIN);\n\n\u002F\u002F Send JSON\nString jsonMessage = \"{\\\"type\\\": \\\"notification\\\", \\\"message\\\": \\\"New update!\\\"}\";\nclient.sendToAll(jsonMessage, WebPubSubContentType.APPLICATION_JSON);\n```\n\n### Send to All with Filter\n\n```java\nimport com.azure.core.http.rest.RequestOptions;\nimport com.azure.core.util.BinaryData;\n\nBinaryData message = BinaryData.fromString(\"Hello filtered users!\");\n\n\u002F\u002F Filter by userId\nclient.sendToAllWithResponse(\n    message,\n    WebPubSubContentType.TEXT_PLAIN,\n    message.getLength(),\n    new RequestOptions().addQueryParam(\"filter\", \"userId ne 'user1'\"));\n\n\u002F\u002F Filter by groups\nclient.sendToAllWithResponse(\n    message,\n    WebPubSubContentType.TEXT_PLAIN,\n    message.getLength(),\n    new RequestOptions().addQueryParam(\"filter\", \"'GroupA' in groups and not('GroupB' in groups)\"));\n```\n\n### Send to Group\n\n```java\n\u002F\u002F Send to all connections in a group\nclient.sendToGroup(\"java-developers\", \"Hello Java devs!\", WebPubSubContentType.TEXT_PLAIN);\n\n\u002F\u002F Send JSON to group\nString json = \"{\\\"event\\\": \\\"update\\\", \\\"data\\\": {\\\"version\\\": \\\"2.0\\\"}}\";\nclient.sendToGroup(\"subscribers\", json, WebPubSubContentType.APPLICATION_JSON);\n```\n\n### Send to Specific Connection\n\n```java\n\u002F\u002F Send to a specific connection by ID\nclient.sendToConnection(\"connectionId123\", \"Private message\", WebPubSubContentType.TEXT_PLAIN);\n```\n\n### Send to User\n\n```java\n\u002F\u002F Send to all connections for a specific user\nclient.sendToUser(\"andy\", \"Hello Andy!\", WebPubSubContentType.TEXT_PLAIN);\n```\n\n### Manage Groups\n\n```java\n\u002F\u002F Add connection to group\nclient.addConnectionToGroup(\"premium-users\", \"connectionId123\");\n\n\u002F\u002F Remove connection from group\nclient.removeConnectionFromGroup(\"premium-users\", \"connectionId123\");\n\n\u002F\u002F Add user to group (all their connections)\nclient.addUserToGroup(\"admin-group\", \"userId456\");\n\n\u002F\u002F Remove user from group\nclient.removeUserFromGroup(\"admin-group\", \"userId456\");\n\n\u002F\u002F Check if user is in group\nboolean exists = client.userExistsInGroup(\"admin-group\", \"userId456\");\n```\n\n### Manage Connections\n\n```java\n\u002F\u002F Check if connection exists\nboolean connected = client.connectionExists(\"connectionId123\");\n\n\u002F\u002F Close a connection\nclient.closeConnection(\"connectionId123\");\n\n\u002F\u002F Close with reason\nclient.closeConnection(\"connectionId123\", \"Session expired\");\n\n\u002F\u002F Check if user exists (has any connections)\nboolean userOnline = client.userExists(\"userId456\");\n\n\u002F\u002F Close all connections for a user\nclient.closeUserConnections(\"userId456\");\n\n\u002F\u002F Close all connections in a group\nclient.closeGroupConnections(\"inactive-group\");\n```\n\n### Generate Client Access Token\n\n```java\nimport com.azure.messaging.webpubsub.models.GetClientAccessTokenOptions;\nimport com.azure.messaging.webpubsub.models.WebPubSubClientAccessToken;\n\n\u002F\u002F Basic token\nWebPubSubClientAccessToken token = client.getClientAccessToken(\n    new GetClientAccessTokenOptions());\nSystem.out.println(\"URL: \" + token.getUrl());\n\n\u002F\u002F With user ID\nWebPubSubClientAccessToken userToken = client.getClientAccessToken(\n    new GetClientAccessTokenOptions().setUserId(\"user123\"));\n\n\u002F\u002F With roles (permissions)\nWebPubSubClientAccessToken roleToken = client.getClientAccessToken(\n    new GetClientAccessTokenOptions()\n        .setUserId(\"user123\")\n        .addRole(\"webpubsub.joinLeaveGroup\")\n        .addRole(\"webpubsub.sendToGroup\"));\n\n\u002F\u002F With groups to join on connect\nWebPubSubClientAccessToken groupToken = client.getClientAccessToken(\n    new GetClientAccessTokenOptions()\n        .setUserId(\"user123\")\n        .addGroup(\"announcements\")\n        .addGroup(\"updates\"));\n\n\u002F\u002F With custom expiration\nWebPubSubClientAccessToken expToken = client.getClientAccessToken(\n    new GetClientAccessTokenOptions()\n        .setUserId(\"user123\")\n        .setExpiresAfter(Duration.ofHours(2)));\n```\n\n### Grant\u002FRevoke Permissions\n\n```java\nimport com.azure.messaging.webpubsub.models.WebPubSubPermission;\n\n\u002F\u002F Grant permission to send to a group\nclient.grantPermission(\n    WebPubSubPermission.SEND_TO_GROUP,\n    \"connectionId123\",\n    new RequestOptions().addQueryParam(\"targetName\", \"chat-room\"));\n\n\u002F\u002F Revoke permission\nclient.revokePermission(\n    WebPubSubPermission.SEND_TO_GROUP,\n    \"connectionId123\",\n    new RequestOptions().addQueryParam(\"targetName\", \"chat-room\"));\n\n\u002F\u002F Check permission\nboolean hasPermission = client.checkPermission(\n    WebPubSubPermission.SEND_TO_GROUP,\n    \"connectionId123\",\n    new RequestOptions().addQueryParam(\"targetName\", \"chat-room\"));\n```\n\n### Async Operations\n\n```java\nasyncClient.sendToAll(\"Async message!\", WebPubSubContentType.TEXT_PLAIN)\n    .subscribe(\n        unused -> System.out.println(\"Message sent\"),\n        error -> System.err.println(\"Error: \" + error.getMessage())\n    );\n\nasyncClient.sendToGroup(\"developers\", \"Group message\", WebPubSubContentType.TEXT_PLAIN)\n    .doOnSuccess(v -> System.out.println(\"Sent to group\"))\n    .doOnError(e -> System.err.println(\"Failed: \" + e))\n    .subscribe();\n```\n\n## Error Handling\n\n```java\nimport com.azure.core.exception.HttpResponseException;\n\ntry {\n    client.sendToConnection(\"invalid-id\", \"test\", WebPubSubContentType.TEXT_PLAIN);\n} catch (HttpResponseException e) {\n    System.out.println(\"Status: \" + e.getResponse().getStatusCode());\n    System.out.println(\"Error: \" + e.getMessage());\n}\n```\n\n## Environment Variables\n\n```bash\nWEB_PUBSUB_CONNECTION_STRING=Endpoint=https:\u002F\u002F\u003Cresource>.webpubsub.azure.com;AccessKey=...  # Alternative to Entra ID auth\nWEB_PUBSUB_ENDPOINT=https:\u002F\u002F\u003Cresource>.webpubsub.azure.com  # Required for AzureKeyCredential or TokenCredential auth\nWEB_PUBSUB_ACCESS_KEY=\u003Cyour-access-key>  # Only required for AzureKeyCredential auth\nAZURE_TOKEN_CREDENTIALS=prod  # Required only if DefaultAzureCredential is used in production\n```\n\n## Client Roles\n\n| Role | Permission |\n|------|------------|\n| `webpubsub.joinLeaveGroup` | Join\u002Fleave any group |\n| `webpubsub.sendToGroup` | Send to any group |\n| `webpubsub.joinLeaveGroup.\u003Cgroup>` | Join\u002Fleave specific group |\n| `webpubsub.sendToGroup.\u003Cgroup>` | Send to specific group |\n\n## Best Practices\n\n1. **Use Groups**: Organize connections into groups for targeted messaging\n2. **User IDs**: Associate connections with user IDs for user-level messaging\n3. **Token Expiration**: Set appropriate token expiration for security\n4. **Roles**: Grant minimal required permissions via roles\n5. **Hub Isolation**: Use separate hubs for different application features\n6. **Connection Management**: Clean up inactive connections\n\n## Trigger Phrases\n\n- \"Web PubSub Java\"\n- \"WebSocket messaging Azure\"\n- \"real-time push notifications\"\n- \"server-sent events\"\n- \"chat application backend\"\n- \"live updates broadcasting\"\n","# Azure Web PubSub SDK for Java\n\nBuild real-time web applications using the Azure Web PubSub SDK for Java.\n\n## Installation\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>com.azure\u003C\u002FgroupId>\n    \u003CartifactId>azure-messaging-webpubsub\u003C\u002FartifactId>\n    \u003Cversion>1.5.0\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\n## Client Creation\n\n### With Connection String\n\n```java\nimport com.azure.messaging.webpubsub.WebPubSubServiceClient;\nimport com.azure.messaging.webpubsub.WebPubSubServiceClientBuilder;\n\nWebPubSubServiceClient client = new WebPubSubServiceClientBuilder()\n    .connectionString(\"\u003Cconnection-string>\")\n    .hub(\"chat\")\n    .buildClient();\n```\n\n### With Access Key\n\n```java\nimport com.azure.core.credential.AzureKeyCredential;\n\nWebPubSubServiceClient client = new WebPubSubServiceClientBuilder()\n    .credential(new AzureKeyCredential(\"\u003Caccess-key>\"))\n    .endpoint(\"\u003Cendpoint>\")\n    .hub(\"chat\")\n    .buildClient();\n```\n\n### With DefaultAzureCredential\n\n```java\nimport com.azure.core.credential.TokenCredential;\nimport com.azure.identity.AzureIdentityEnvVars;\nimport com.azure.identity.DefaultAzureCredentialBuilder;\nimport com.azure.identity.ManagedIdentityCredentialBuilder;\n\n\u002F\u002F Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\nTokenCredential credential = new DefaultAzureCredentialBuilder()\n    .requireEnvVars(AzureIdentityEnvVars.AZURE_TOKEN_CREDENTIALS)\n    .build();\n\u002F\u002F Or use a specific credential directly in production:\n\u002F\u002F See https:\u002F\u002Flearn.microsoft.com\u002Fjava\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-java-stable#credential-classes\n\u002F\u002F TokenCredential credential = new ManagedIdentityCredentialBuilder().build();\n\nWebPubSubServiceClient client = new WebPubSubServiceClientBuilder()\n    .credential(credential)\n    .endpoint(\"\u003Cendpoint>\")\n    .hub(\"chat\")\n    .buildClient();\n```\n\n### Async Client\n\n```java\nimport com.azure.messaging.webpubsub.WebPubSubServiceAsyncClient;\n\nWebPubSubServiceAsyncClient asyncClient = new WebPubSubServiceClientBuilder()\n    .connectionString(\"\u003Cconnection-string>\")\n    .hub(\"chat\")\n    .buildAsyncClient();\n```\n\n## Key Concepts\n\n- **Hub**: Logical isolation unit for connections\n- **Group**: Subset of connections within a hub\n- **Connection**: Individual WebSocket client connection\n- **User**: Entity that can have multiple connections\n\n## Core Patterns\n\n### Send to All Connections\n\n```java\nimport com.azure.messaging.webpubsub.models.WebPubSubContentType;\n\n\u002F\u002F Send text message\nclient.sendToAll(\"Hello everyone!\", WebPubSubContentType.TEXT_PLAIN);\n\n\u002F\u002F Send JSON\nString jsonMessage = \"{\\\"type\\\": \\\"notification\\\", \\\"message\\\": \\\"New update!\\\"}\";\nclient.sendToAll(jsonMessage, WebPubSubContentType.APPLICATION_JSON);\n```\n\n### Send to All with Filter\n\n```java\nimport com.azure.core.http.rest.RequestOptions;\nimport com.azure.core.util.BinaryData;\n\nBinaryData message = BinaryData.fromString(\"Hello filtered users!\");\n\n\u002F\u002F Filter by userId\nclient.sendToAllWithResponse(\n    message,\n    WebPubSubContentType.TEXT_PLAIN,\n    message.getLength(),\n    new RequestOptions().addQueryParam(\"filter\", \"userId ne 'user1'\"));\n\n\u002F\u002F Filter by groups\nclient.sendToAllWithResponse(\n    message,\n    WebPubSubContentType.TEXT_PLAIN,\n    message.getLength(),\n    new RequestOptions().addQueryParam(\"filter\", \"'GroupA' in groups and not('GroupB' in groups)\"));\n```\n\n### Send to Group\n\n```java\n\u002F\u002F Send to all connections in a group\nclient.sendToGroup(\"java-developers\", \"Hello Java devs!\", WebPubSubContentType.TEXT_PLAIN);\n\n\u002F\u002F Send JSON to group\nString json = \"{\\\"event\\\": \\\"update\\\", \\\"data\\\": {\\\"version\\\": \\\"2.0\\\"}}\";\nclient.sendToGroup(\"subscribers\", json, WebPubSubContentType.APPLICATION_JSON);\n```\n\n### Send to Specific Connection\n\n```java\n\u002F\u002F Send to a specific connection by ID\nclient.sendToConnection(\"connectionId123\", \"Private message\", WebPubSubContentType.TEXT_PLAIN);\n```\n\n### Send to User\n\n```java\n\u002F\u002F Send to all connections for a specific user\nclient.sendToUser(\"andy\", \"Hello Andy!\", WebPubSubContentType.TEXT_PLAIN);\n```\n\n### Manage Groups\n\n```java\n\u002F\u002F Add connection to group\nclient.addConnectionToGroup(\"premium-users\", \"connectionId123\");\n\n\u002F\u002F Remove connection from group\nclient.removeConnectionFromGroup(\"premium-users\", \"connectionId123\");\n\n\u002F\u002F Add user to group (all their connections)\nclient.addUserToGroup(\"admin-group\", \"userId456\");\n\n\u002F\u002F Remove user from group\nclient.removeUserFromGroup(\"admin-group\", \"userId456\");\n\n\u002F\u002F Check if user is in group\nboolean exists = client.userExistsInGroup(\"admin-group\", \"userId456\");\n```\n\n### Manage Connections\n\n```java\n\u002F\u002F Check if connection exists\nboolean connected = client.connectionExists(\"connectionId123\");\n\n\u002F\u002F Close a connection\nclient.closeConnection(\"connectionId123\");\n\n\u002F\u002F Close with reason\nclient.closeConnection(\"connectionId123\", \"Session expired\");\n\n\u002F\u002F Check if user exists (has any connections)\nboolean userOnline = client.userExists(\"userId456\");\n\n\u002F\u002F Close all connections for a user\nclient.closeUserConnections(\"userId456\");\n\n\u002F\u002F Close all connections in a group\nclient.closeGroupConnections(\"inactive-group\");\n```\n\n### Generate Client Access Token\n\n```java\nimport com.azure.messaging.webpubsub.models.GetClientAccessTokenOptions;\nimport com.azure.messaging.webpubsub.models.WebPubSubClientAccessToken;\n\n\u002F\u002F Basic token\nWebPubSubClientAccessToken token = client.getClientAccessToken(\n    new GetClientAccessTokenOptions());\nSystem.out.println(\"URL: \" + token.getUrl());\n\n\u002F\u002F With user ID\nWebPubSubClientAccessToken userToken = client.getClientAccessToken(\n    new GetClientAccessTokenOptions().setUserId(\"user123\"));\n\n\u002F\u002F With roles (permissions)\nWebPubSubClientAccessToken roleToken = client.getClientAccessToken(\n    new GetClientAccessTokenOptions()\n        .setUserId(\"user123\")\n        .addRole(\"webpubsub.joinLeaveGroup\")\n        .addRole(\"webpubsub.sendToGroup\"));\n\n\u002F\u002F With groups to join on connect\nWebPubSubClientAccessToken groupToken = client.getClientAccessToken(\n    new GetClientAccessTokenOptions()\n        .setUserId(\"user123\")\n        .addGroup(\"announcements\")\n        .addGroup(\"updates\"));\n\n\u002F\u002F With custom expiration\nWebPubSubClientAccessToken expToken = client.getClientAccessToken(\n    new GetClientAccessTokenOptions()\n        .setUserId(\"user123\")\n        .setExpiresAfter(Duration.ofHours(2)));\n```\n\n### Grant\u002FRevoke Permissions\n\n```java\nimport com.azure.messaging.webpubsub.models.WebPubSubPermission;\n\n\u002F\u002F Grant permission to send to a group\nclient.grantPermission(\n    WebPubSubPermission.SEND_TO_GROUP,\n    \"connectionId123\",\n    new RequestOptions().addQueryParam(\"targetName\", \"chat-room\"));\n\n\u002F\u002F Revoke permission\nclient.revokePermission(\n    WebPubSubPermission.SEND_TO_GROUP,\n    \"connectionId123\",\n    new RequestOptions().addQueryParam(\"targetName\", \"chat-room\"));\n\n\u002F\u002F Check permission\nboolean hasPermission = client.checkPermission(\n    WebPubSubPermission.SEND_TO_GROUP,\n    \"connectionId123\",\n    new RequestOptions().addQueryParam(\"targetName\", \"chat-room\"));\n```\n\n### Async Operations\n\n```java\nasyncClient.sendToAll(\"Async message!\", WebPubSubContentType.TEXT_PLAIN)\n    .subscribe(\n        unused -> System.out.println(\"Message sent\"),\n        error -> System.err.println(\"Error: \" + error.getMessage())\n    );\n\nasyncClient.sendToGroup(\"developers\", \"Group message\", WebPubSubContentType.TEXT_PLAIN)\n    .doOnSuccess(v -> System.out.println(\"Sent to group\"))\n    .doOnError(e -> System.err.println(\"Failed: \" + e))\n    .subscribe();\n```\n\n## Error Handling\n\n```java\nimport com.azure.core.exception.HttpResponseException;\n\ntry {\n    client.sendToConnection(\"invalid-id\", \"test\", WebPubSubContentType.TEXT_PLAIN);\n} catch (HttpResponseException e) {\n    System.out.println(\"Status: \" + e.getResponse().getStatusCode());\n    System.out.println(\"Error: \" + e.getMessage());\n}\n```\n\n## Environment Variables\n\n```bash\nWEB_PUBSUB_CONNECTION_STRING=Endpoint=https:\u002F\u002F\u003Cresource>.webpubsub.azure.com;AccessKey=...  # Alternative to Entra ID auth\nWEB_PUBSUB_ENDPOINT=https:\u002F\u002F\u003Cresource>.webpubsub.azure.com  # Required for AzureKeyCredential or TokenCredential auth\nWEB_PUBSUB_ACCESS_KEY=\u003Cyour-access-key>  # Only required for AzureKeyCredential auth\nAZURE_TOKEN_CREDENTIALS=prod  # Required only if DefaultAzureCredential is used in production\n```\n\n## Client Roles\n\n| Role | Permission |\n|------|------------|\n| `webpubsub.joinLeaveGroup` | Join\u002Fleave any group |\n| `webpubsub.sendToGroup` | Send to any group |\n| `webpubsub.joinLeaveGroup.\u003Cgroup>` | Join\u002Fleave specific group |\n| `webpubsub.sendToGroup.\u003Cgroup>` | Send to specific group |\n\n## Best Practices\n\n1. **Use Groups**: Organize connections into groups for targeted messaging\n2. **User IDs**: Associate connections with user IDs for user-level messaging\n3. **Token Expiration**: Set appropriate token expiration for security\n4. **Roles**: Grant minimal required permissions via roles\n5. **Hub Isolation**: Use separate hubs for different application features\n6. **Connection Management**: Clean up inactive connections\n\n## Trigger Phrases\n\n- \"Web PubSub Java\"\n- \"WebSocket messaging Azure\"\n- \"real-time push notifications\"\n- \"server-sent events\"\n- \"chat application backend\"\n- \"live updates broadcasting\"\n",{"name":5,"license":15,"metadata":46,"description":7},{"author":12,"package":47,"version":48},"com.azure:azure-messaging-webpubsub","1.0.0","main","3f5b461b2314e01c400564051e92469114c5b68f",".github\u002Fplugins\u002Fazure-sdk-java\u002Fskills\u002Fazure-messaging-webpubsub-java",366,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills","https:\u002F\u002Fmicrosoft.github.io\u002Fskills\u002F","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-13 02:10:26",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add microsoft\u002Fskills --skill azure-messaging-webpubsub-java",{"tool":65,"command":66},"bunx","bunx skills add microsoft\u002Fskills --skill azure-messaging-webpubsub-java",{"tool":68,"command":69},"pnpm","pnpm dlx skills add microsoft\u002Fskills --skill azure-messaging-webpubsub-java","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fazure-sdk-java\u002Fskills\u002Fazure-messaging-webpubsub-java\u002FSKILL.md",true,[73],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fexamples.md","REFERENCE","参考文档",13265,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fazure-sdk-java\u002Fskills\u002Fazure-messaging-webpubsub-java\u002Freferences\u002Fexamples.md",[80,106,144,171,191,228],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":91,"publishedAt":41},"01M69B4JCRQV5SPXAFCKXQRV0H","skill-creator","Guide for creating effective skills for AI coding agents working with Azure SDKs and Microsoft Foundry services. Use when creating new skills or updating existing skills.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fskill-creator\u002FSKILL.md",[86],{"categoryNo":87,"categoryName":88,"taxonomyType":89,"taxonomyTypeDesc":90},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[92,93,94,9,95,96,97,20,98,99,100,33,101,102,103,26,104,25,105],"skill creator","creator","coding agents","foundry","microsoft foundry","ai coding agents","services","coding","guide","ai coding","with","sdks","Existing","new",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":122,"publishedAt":41},"01M69B4FD57V1MYKRWAJJECTZ7","podcast-generation","Generate AI-powered podcast-style audio narratives using Azure OpenAI's GPT Realtime Mini model via WebSocket. Use when building text-to-speech features, audio narrative generation, podcast creation from content, or integrating with Azure OpenAI Realtime API for real audio output. Covers full-stack implementation from React frontend to Python FastAPI backend with WebSocket streaming.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fpodcast-generation\u002FSKILL.md",[112,115,118,121],{"categoryNo":113,"categoryName":114,"taxonomyType":89,"taxonomyTypeDesc":90},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":116,"categoryName":117,"taxonomyType":89,"taxonomyTypeDesc":90},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":119,"categoryName":120,"taxonomyType":89,"taxonomyTypeDesc":90},"01JBSEEDCAT000000000000016","图像与多媒体",{"categoryNo":87,"categoryName":88,"taxonomyType":89,"taxonomyTypeDesc":90},[123,124,125,126,127,128,129,20,130,131,132,133,134,135,136,137,138,139,140,141,142,25,143],"podcast generation","podcast","generation","frontend","python","react","realtime","azure openai","generate","streaming","api","Audio","stack","text","model","fastapi","creation","python fastapi","narrative","features","fastapi backend",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":151,"publishedAt":41},"01M69B4CYPM5SESY5ZWEFDXEQZ","microsoft-docs","Understand Microsoft technologies by querying official documentation. Use whenever the user asks how something works, wants tutorials, needs configuration options, limits, quotas, or best practices for any Microsoft technology (Azure, .NET, M365, Windows, Power Platform, etc.)—even if they don't mention \"docs.\" If the question is about understanding a concept rather than writing code, this is the right skill.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fmicrosoft-docs\u002FSKILL.md",[150],{"categoryNo":87,"categoryName":88,"taxonomyType":89,"taxonomyTypeDesc":90},[152,9,153,154,155,156,157,158,159,160,161,20,162,163,164,33,165,62,166,167,168,169,170,26],"docs","microsoft docs","MCP","writing","cli","mcp server","windows","power platform","official","documentation","learn","best practices","question","power","back","technology","platform","learn mcp","concept",{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":178,"publishedAt":41},"01M69B49C3YPD1ZJ3NC0HPCY58","mcp-builder","Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP), Node\u002FTypeScript (MCP SDK), or C#\u002F.NET (Microsoft MCP SDK).","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fmcp-builder\u002FSKILL.md",[177],{"categoryNo":87,"categoryName":88,"taxonomyType":89,"taxonomyTypeDesc":90},[154,179,180,181,127,182,36,183,9,184,185,137,186,187,100,33,188,189,190,102,26,25],"mcp builder","builder","typescript","llms","model context protocol","fastmcp","Tools","node","context","integrate","mcp sdk","building mcp servers",{"skillNo":192,"name":193,"nameZh":6,"description":194,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":195,"categories":196,"keywords":209,"publishedAt":41},"01M69B467A7CDMFQ0T6Q0ZA12Q","kql","KQL language expertise for writing correct, efficient Kusto Query Language queries. Covers syntax gotchas, join patterns, dynamic types, datetime pitfalls, regex patterns, serialization, memory management, result-size discipline, and advanced functions (geo, vector, graph). USE THIS SKILL whenever writing, debugging, or reviewing KQL queries — even simple ones — because the gotchas section prevents the most common errors that waste tool calls and cause expensive retry cascades. Trigger on: KQL, Kusto, ADX, Azure Data Explorer, Fabric Real-Time Intelligence, EventHouse, Log Analytics, log analysis, data exploration, time series, anomaly detection, summarize, where clause, join, extend, project, let statement, parse operator, extract function, any mention of pipe-forward query syntax.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fkql\u002FSKILL.md",[197,200,201,206],{"categoryNo":198,"categoryName":199,"taxonomyType":89,"taxonomyTypeDesc":90},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":87,"categoryName":88,"taxonomyType":89,"taxonomyTypeDesc":90},{"categoryNo":202,"categoryName":203,"taxonomyType":204,"taxonomyTypeDesc":205},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",{"categoryNo":207,"categoryName":208,"taxonomyType":204,"taxonomyTypeDesc":205},"01JBSEEDCAT000000000000036","内容创作者",[193,155,210,211,212,20,213,214,215,216,217,218,219,220,32,221,222,223,224,26,225,226,227],"summarize","memory","analytics","vector","time series","tool","discipline","log","geo","exploration","pipe","project","regex","join","datetime","section","anomaly","parse",{"skillNo":229,"name":230,"nameZh":6,"description":231,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":232,"categories":233,"keywords":234,"publishedAt":41},"01M69B44HJQ7897EZ7NE7DWQX3","github-issue-creator","Convert raw notes, error logs, voice dictation, or screenshots into crisp GitHub-flavored markdown issue reports. Use when the user pastes bug info, error messages, or informal descriptions and wants a structured GitHub issue. Supports images\u002FGIFs for visual evidence.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgithub-issue-creator\u002FSKILL.md",[],[235,236,237,238,93,239,240,241,242,243,244,245,33,246,247,248,249,250,251,26,25],"github","github issue creator","github issue","issue","issue creator","screenshots","notes","logs","error messages","messages","convert","evidence","reports","images","info","visual","error"]