Official agent skill

Azure Messaging Webpubsub Java

by microsoft in microsoft/skills

Build real-time web applications with Azure Web PubSub SDK for Java.

OfficialMITAuto-check passedBackend & APIs

Install Azure Messaging Webpubsub Java

skills CLI
$ npx skills add microsoft/skills --skill azure-messaging-webpubsub-java -a claude-code

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

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

At a glance

Build real-time web applications with Azure Web PubSub SDK for Java.

  • Works in 6 steps: Use Groups: Organize connections into… → User IDs: Associate connections with… → Token Expiration: Set appropriate token… → …
  • Implementing WebSocket-based messaging
  • SKILL.md covers Installation, Client Creation, Key Concepts and Core Patterns, plus 5 more sections
  • Reaches learn.microsoft.com; needs AZURE_TOKEN_CREDENTIALS and WEB_PUBSUB_ACCESS_KEY

What it does

Azure Messaging Webpubsub Java is an agent skill from microsoft/skills, published by the product's own GitHub organization. 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.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/examples.md`).

It sits in Backend & APIs, covering Realtime and WebSockets. It works with Java, Microsoft Azure and Azure Web PubSub. 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

  • Implementing WebSocket-based messaging
  • Chat applications
  • Server-to-client push notifications

Example prompts

  • “/azure-messaging-webpubsub-java”

Requirements

  • A credential in WEB_PUBSUB_ACCESS_KEY

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Use Groups: Organize connections into groups for targeted messaging
  2. User IDs: Associate connections with user IDs for user-level messaging
  3. Token Expiration: Set appropriate token expiration for security
  4. Roles: Grant minimal required permissions via roles
  5. Hub Isolation: Use separate hubs for different application features
  6. Connection Management: Clean up inactive connections

What it can do on your machine

Read from SKILL.md and the folder at commit 354361d. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are java, xml and bash).

    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
    • WEB_PUBSUB_ACCESS_KEY

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

Context cost

Azure Messaging Webpubsub Java loads about 2.4k tokens when it runs, and up to ~5.7k if it reads all its reference files. Until then it costs about 55 tokens; SKILL.md has 193 words of instructions outside code blocks.

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

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 354361d, republished under its MIT licence (© microsoft). 193 words, ~2,378 tokens.

Download SKILL.mdSave it as .claude/skills/azure-messaging-webpubsub-java/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
azure-messaging-webpubsub-java
description
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.
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0
metadata.package
com.azure:azure-messaging-webpubsub

Azure Web PubSub SDK for Java

Build real-time web applications using the Azure Web PubSub SDK for Java.

Installation

xml
<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-messaging-webpubsub</artifactId>
    <version>1.5.0</version>
</dependency>

Client Creation

With Connection String
java
import com.azure.messaging.webpubsub.WebPubSubServiceClient;
import com.azure.messaging.webpubsub.WebPubSubServiceClientBuilder;

WebPubSubServiceClient client = new WebPubSubServiceClientBuilder()
    .connectionString("<connection-string>")
    .hub("chat")
    .buildClient();
With Access Key
java
import com.azure.core.credential.AzureKeyCredential;

WebPubSubServiceClient client = new WebPubSubServiceClientBuilder()
    .credential(new AzureKeyCredential("<access-key>"))
    .endpoint("<endpoint>")
    .hub("chat")
    .buildClient();
With DefaultAzureCredential
java
import com.azure.core.credential.TokenCredential;
import com.azure.identity.AzureIdentityEnvVars;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.identity.ManagedIdentityCredentialBuilder;

// Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
TokenCredential credential = new DefaultAzureCredentialBuilder()
    .requireEnvVars(AzureIdentityEnvVars.AZURE_TOKEN_CREDENTIALS)
    .build();
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable#credential-classes
// TokenCredential credential = new ManagedIdentityCredentialBuilder().build();

WebPubSubServiceClient client = new WebPubSubServiceClientBuilder()
    .credential(credential)
    .endpoint("<endpoint>")
    .hub("chat")
    .buildClient();
Async Client
java
import com.azure.messaging.webpubsub.WebPubSubServiceAsyncClient;

WebPubSubServiceAsyncClient asyncClient = new WebPubSubServiceClientBuilder()
    .connectionString("<connection-string>")
    .hub("chat")
    .buildAsyncClient();

Key Concepts

  • Hub: Logical isolation unit for connections
  • Group: Subset of connections within a hub
  • Connection: Individual WebSocket client connection
  • User: Entity that can have multiple connections

Core Patterns

Send to All Connections
java
import com.azure.messaging.webpubsub.models.WebPubSubContentType;

// Send text message
client.sendToAll("Hello everyone!", WebPubSubContentType.TEXT_PLAIN);

// Send JSON
String jsonMessage = "{\"type\": \"notification\", \"message\": \"New update!\"}";
client.sendToAll(jsonMessage, WebPubSubContentType.APPLICATION_JSON);
Send to All with Filter
java
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.util.BinaryData;

BinaryData message = BinaryData.fromString("Hello filtered users!");

// Filter by userId
client.sendToAllWithResponse(
    message,
    WebPubSubContentType.TEXT_PLAIN,
    message.getLength(),
    new RequestOptions().addQueryParam("filter", "userId ne 'user1'"));

// Filter by groups
client.sendToAllWithResponse(
    message,
    WebPubSubContentType.TEXT_PLAIN,
    message.getLength(),
    new RequestOptions().addQueryParam("filter", "'GroupA' in groups and not('GroupB' in groups)"));
Send to Group
java
// Send to all connections in a group
client.sendToGroup("java-developers", "Hello Java devs!", WebPubSubContentType.TEXT_PLAIN);

// Send JSON to group
String json = "{\"event\": \"update\", \"data\": {\"version\": \"2.0\"}}";
client.sendToGroup("subscribers", json, WebPubSubContentType.APPLICATION_JSON);
Send to Specific Connection
java
// Send to a specific connection by ID
client.sendToConnection("connectionId123", "Private message", WebPubSubContentType.TEXT_PLAIN);
Send to User
java
// Send to all connections for a specific user
client.sendToUser("andy", "Hello Andy!", WebPubSubContentType.TEXT_PLAIN);
Manage Groups
java
// Add connection to group
client.addConnectionToGroup("premium-users", "connectionId123");

// Remove connection from group
client.removeConnectionFromGroup("premium-users", "connectionId123");

// Add user to group (all their connections)
client.addUserToGroup("admin-group", "userId456");

// Remove user from group
client.removeUserFromGroup("admin-group", "userId456");

// Check if user is in group
boolean exists = client.userExistsInGroup("admin-group", "userId456");
Manage Connections
java
// Check if connection exists
boolean connected = client.connectionExists("connectionId123");

// Close a connection
client.closeConnection("connectionId123");

// Close with reason
client.closeConnection("connectionId123", "Session expired");

// Check if user exists (has any connections)
boolean userOnline = client.userExists("userId456");

// Close all connections for a user
client.closeUserConnections("userId456");

// Close all connections in a group
client.closeGroupConnections("inactive-group");
Generate Client Access Token
java
import com.azure.messaging.webpubsub.models.GetClientAccessTokenOptions;
import com.azure.messaging.webpubsub.models.WebPubSubClientAccessToken;

// Basic token
WebPubSubClientAccessToken token = client.getClientAccessToken(
    new GetClientAccessTokenOptions());
System.out.println("URL: " + token.getUrl());

// With user ID
WebPubSubClientAccessToken userToken = client.getClientAccessToken(
    new GetClientAccessTokenOptions().setUserId("user123"));

// With roles (permissions)
WebPubSubClientAccessToken roleToken = client.getClientAccessToken(
    new GetClientAccessTokenOptions()
        .setUserId("user123")
        .addRole("webpubsub.joinLeaveGroup")
        .addRole("webpubsub.sendToGroup"));

// With groups to join on connect
WebPubSubClientAccessToken groupToken = client.getClientAccessToken(
    new GetClientAccessTokenOptions()
        .setUserId("user123")
        .addGroup("announcements")
        .addGroup("updates"));

// With custom expiration
WebPubSubClientAccessToken expToken = client.getClientAccessToken(
    new GetClientAccessTokenOptions()
        .setUserId("user123")
        .setExpiresAfter(Duration.ofHours(2)));
Grant/Revoke Permissions
java
import com.azure.messaging.webpubsub.models.WebPubSubPermission;

// Grant permission to send to a group
client.grantPermission(
    WebPubSubPermission.SEND_TO_GROUP,
    "connectionId123",
    new RequestOptions().addQueryParam("targetName", "chat-room"));

// Revoke permission
client.revokePermission(
    WebPubSubPermission.SEND_TO_GROUP,
    "connectionId123",
    new RequestOptions().addQueryParam("targetName", "chat-room"));

// Check permission
boolean hasPermission = client.checkPermission(
    WebPubSubPermission.SEND_TO_GROUP,
    "connectionId123",
    new RequestOptions().addQueryParam("targetName", "chat-room"));
Async Operations
java
asyncClient.sendToAll("Async message!", WebPubSubContentType.TEXT_PLAIN)
    .subscribe(
        unused -> System.out.println("Message sent"),
        error -> System.err.println("Error: " + error.getMessage())
    );

asyncClient.sendToGroup("developers", "Group message", WebPubSubContentType.TEXT_PLAIN)
    .doOnSuccess(v -> System.out.println("Sent to group"))
    .doOnError(e -> System.err.println("Failed: " + e))
    .subscribe();

Error Handling

java
import com.azure.core.exception.HttpResponseException;

try {
    client.sendToConnection("invalid-id", "test", WebPubSubContentType.TEXT_PLAIN);
} catch (HttpResponseException e) {
    System.out.println("Status: " + e.getResponse().getStatusCode());
    System.out.println("Error: " + e.getMessage());
}

Environment Variables

bash
WEB_PUBSUB_CONNECTION_STRING=Endpoint=https://<resource>.webpubsub.azure.com;AccessKey=...  # Alternative to Entra ID auth
WEB_PUBSUB_ENDPOINT=https://<resource>.webpubsub.azure.com  # Required for AzureKeyCredential or TokenCredential auth
WEB_PUBSUB_ACCESS_KEY=<your-access-key>  # Only required for AzureKeyCredential auth
AZURE_TOKEN_CREDENTIALS=prod  # Required only if DefaultAzureCredential is used in production

Client Roles

RolePermission
webpubsub.joinLeaveGroupJoin/leave any group
webpubsub.sendToGroupSend to any group
webpubsub.joinLeaveGroup.<group>Join/leave specific group
webpubsub.sendToGroup.<group>Send to specific group

Best Practices

  1. Use Groups: Organize connections into groups for targeted messaging
  2. User IDs: Associate connections with user IDs for user-level messaging
  3. Token Expiration: Set appropriate token expiration for security
  4. Roles: Grant minimal required permissions via roles
  5. Hub Isolation: Use separate hubs for different application features
  6. Connection Management: Clean up inactive connections

Trigger Phrases

  • "Web PubSub Java"
  • "WebSocket messaging Azure"
  • "real-time push notifications"
  • "server-sent events"
  • "chat application backend"
  • "live updates broadcasting"

© 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 1 other file (references) in .github/plugins/azure-sdk-java/skills/azure-messaging-webpubsub-java of microsoft/skills.

  • SKILL.md
  • references/examples.md

Open the folder on GitHubat commit 354361d

Used in 6 other repositories

We found 15 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 6 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 Webpubsub Java 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 Webpubsub Java compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure Messaging Webpubsub Java this skillmicrosoft/skills3.1k6 repos~2.4kAutomated safety check: PassMIT
Azure Web PubsubMicrosoftDocs/Agent-Skills775—~4.2kAutomated safety check: PassCC-BY-4.0
Tiger Brokers Java SDKqusong0627/QuantMind1.7k—~1.2kAutomated safety check: PassApache-2.0
Tinystruct Patternsaffaan-m/ECC274k1 repos~3kAutomated safety check: PassMIT
Azure Web Pubsub TSaiskillstore/marketplace4305 repos~2kAutomated safety check: PassNone
Ak Cloud Deployyaalalabs/agent-kernel191—~14kAutomated safety check: PassApache-2.0

Similar skills

  • 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 &…

    775 GitHub stars~4.2k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Tiger Brokers Java SDK

    qusong0627/QuantMind

    Reference guides for the Tiger Brokers OpenAPI Java SDK: setup, market data, stock, futures and options trading, real-time push, account queries and strategy examples.

    1.7k GitHub stars~1.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Expert guidance for developing with the tinystruct Java framework.

    274k GitHub starsUsed in 1 repo~3k 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 5 repos~2k tokens
    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.

    191 GitHub stars~14k tokensUpdated today
    Backend & APIsAuto-check passed
  • Azure Fluid Relay

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Fluid Relay development including troubleshooting, best practices, limits & quotas, security, configuration, integrations & coding patterns, and deployment.

    775 GitHub stars~1.6k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from microsoft/skills

All 150 skills in this repo
  • 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 starsUsed in 6 repos~2.8k tokens
    Auto-check passed
  • Official

    Python guidance for the Azure AI Search SDK covering vector, hybrid and semantic search, index management and indexers, with Entra ID authentication preferred over keys.

    3.1k GitHub starsUsed in 6 repos~4.4k tokens
    Auto-check passed
  • 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
  • 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 6 repos~496 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

Categories

Questions about Azure Messaging Webpubsub Java

What does Azure Messaging Webpubsub Java do?

Build real-time web applications with Azure Web PubSub SDK for Java. Azure Messaging Webpubsub Java is an agent skill from microsoft/skills, published by the product's own GitHub organization. Build real-time web applications with Azure Web PubSub SDK for Java.

When should I use Azure Messaging Webpubsub Java?

Azure Messaging Webpubsub Java fits situations like: implementing WebSocket-based messaging; chat applications; server-to-client push notifications.

How do I install Azure Messaging Webpubsub Java in Claude Code?

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

How do I install Azure Messaging Webpubsub Java in Codex?

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

Can I use Azure Messaging Webpubsub Java 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-webpubsub-java -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-webpubsub-java, .gemini/skills/azure-messaging-webpubsub-java, .github/skills/azure-messaging-webpubsub-java and .opencode/skills/azure-messaging-webpubsub-java in your project.

What does Azure Messaging Webpubsub Java need to run?

Going by SKILL.md and its folder, Azure Messaging Webpubsub Java needs credentials named AZURE_TOKEN_CREDENTIALS and WEB_PUBSUB_ACCESS_KEY. Our summary lists: A credential in WEB_PUBSUB_ACCESS_KEY.

Does Azure Messaging Webpubsub Java 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 Webpubsub Java 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 Webpubsub Java use?

Azure Messaging Webpubsub Java 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 Webpubsub Java use?

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

What are the alternatives to Azure Messaging Webpubsub Java?

Skills that share tags, products or a category with Azure Messaging Webpubsub Java: Azure Web Pubsub (MicrosoftDocs/Agent-Skills, 775 stars), Tiger Brokers Java SDK (qusong0627/QuantMind, 1.7k stars), Tinystruct Patterns (affaan-m/ECC, 274k stars) and Azure Web Pubsub TS (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure Messaging Webpubsub Java?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,086 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 6, 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.