Official agent skill

Azure Servicebus TS

by microsoft in microsoft/skills

Build messaging applications using Azure Service Bus SDK for JavaScript (@azure/service-bus).

OfficialMITAuto-check passedBackend & APIs

Install Azure Servicebus TS

skills CLI
$ npx skills add microsoft/skills --skill azure-servicebus-ts -a claude-code

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

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

At a glance

Build messaging applications using Azure Service Bus SDK for JavaScript (@azure/service-bus).

  • Works in 7 steps: Use Microsoft Entra Token Credential -… → Reuse clients - Create ServiceBusClient… → Close resources - Always close… → …
  • Implementing queues
  • SKILL.md covers Installation, Environment Variables, Authentication and Core Workflow, plus 9 more sections
  • Calls npm; reaches learn.microsoft.com; needs AZURE_TOKEN_CREDENTIALS

What it does

Azure Servicebus TS is an agent skill from microsoft/skills, published by the product's own GitHub organization. Build messaging applications using Azure Service Bus SDK for JavaScript (@azure/service-bus). Use when implementing queues, topics/subscriptions, message sessions, dead-letter handling, or enterprise messaging patterns.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/error-handling.md` and `references/queues-topics.md`).

It sits in Backend & APIs. It works with Azure Service Bus, TypeScript and JavaScript. 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 queues
  • Topics/subscriptions
  • Message sessions
  • Dead-letter handling

Example prompts

  • “/azure-servicebus-ts”

Requirements

  • Node.js

Workflow steps

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

  1. Use Microsoft Entra Token Credential - Use DefaultAzureCredential for local development; use ManagedIdentityCredential or…
  2. Reuse clients - Create ServiceBusClient once, share across senders/receivers
  3. Close resources - Always close senders/receivers when done
  4. Handle errors - Implement processError callback for subscription receivers
  5. Use sessions for ordering - When message order matters within a group
  6. Configure dead-letter - Always handle DLQ messages
  7. Batch sends - Use createMessageBatch() for multiple messages

What it can do on your machine

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

    • npm

    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 Servicebus TS loads about 1.8k tokens when it runs, and up to ~7.1k if it reads all its reference files. Until then it costs about 60 tokens; SKILL.md has 150 words of instructions outside code blocks.

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

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 d5741a1, republished under its MIT licence (© microsoft). 150 words, ~1,812 tokens.

Download SKILL.mdSave it as .claude/skills/azure-servicebus-ts/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
azure-servicebus-ts
description
Build messaging applications using Azure Service Bus SDK for JavaScript (@azure/service-bus). Use when implementing queues, topics/subscriptions, message sessions, dead-letter handling, or enterprise messaging patterns.
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0
metadata.package
@azure/service-bus

Azure Service Bus SDK for TypeScript

Enterprise messaging with queues, topics, and subscriptions.

Installation

bash
npm install @azure/service-bus @azure/identity

Environment Variables

bash
SERVICEBUS_NAMESPACE=<namespace>.servicebus.windows.net
SERVICEBUS_QUEUE_NAME=my-queue
SERVICEBUS_TOPIC_NAME=my-topic
SERVICEBUS_SUBSCRIPTION_NAME=my-subscription
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production

Authentication

typescript
import { ServiceBusClient } from "@azure/service-bus";
import { DefaultAzureCredential, ManagedIdentityCredential } from "@azure/identity";

// Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
const credential = new DefaultAzureCredential({requiredEnvVars: ["AZURE_TOKEN_CREDENTIALS"]});
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/javascript/api/overview/azure/identity-readme?view=azure-node-latest#credential-classes
// const credential = new ManagedIdentityCredential();

const fullyQualifiedNamespace = process.env.SERVICEBUS_NAMESPACE!;
const client = new ServiceBusClient(fullyQualifiedNamespace, credential);

Core Workflow

Send Messages to Queue
typescript
const sender = client.createSender("my-queue");

// Single message
await sender.sendMessages({
  body: { orderId: "12345", amount: 99.99 },
  contentType: "application/json",
});

// Batch messages
const batch = await sender.createMessageBatch();
batch.tryAddMessage({ body: "Message 1" });
batch.tryAddMessage({ body: "Message 2" });
await sender.sendMessages(batch);

await sender.close();
Receive Messages from Queue
typescript
const receiver = client.createReceiver("my-queue");

// Receive batch
const messages = await receiver.receiveMessages(10, { maxWaitTimeInMs: 5000 });
for (const message of messages) {
  console.log(`Received: ${message.body}`);
  await receiver.completeMessage(message);
}

await receiver.close();
Subscribe to Messages (Event-Driven)
typescript
const receiver = client.createReceiver("my-queue");

const subscription = receiver.subscribe({
  processMessage: async (message) => {
    console.log(`Processing: ${message.body}`);
    // Message auto-completed on success
  },
  processError: async (args) => {
    console.error(`Error: ${args.error}`);
  },
});

// Stop after some time
setTimeout(async () => {
  await subscription.close();
  await receiver.close();
}, 60000);
Topics and Subscriptions
typescript
// Send to topic
const topicSender = client.createSender("my-topic");
await topicSender.sendMessages({
  body: { event: "order.created", data: { orderId: "123" } },
  applicationProperties: { eventType: "order.created" },
});

// Receive from subscription
const subscriptionReceiver = client.createReceiver("my-topic", "my-subscription");
const messages = await subscriptionReceiver.receiveMessages(10);

Message Sessions

typescript
// Send session message
const sender = client.createSender("session-queue");
await sender.sendMessages({
  body: { step: 1, data: "First step" },
  sessionId: "workflow-123",
});

// Receive session messages
const sessionReceiver = await client.acceptSession("session-queue", "workflow-123");
const messages = await sessionReceiver.receiveMessages(10);

// Get/set session state
const state = await sessionReceiver.getSessionState();
await sessionReceiver.setSessionState(Buffer.from(JSON.stringify({ progress: 50 })));

await sessionReceiver.close();

Dead-Letter Handling

typescript
// Move to dead-letter
await receiver.deadLetterMessage(message, {
  deadLetterReason: "Validation failed",
  deadLetterErrorDescription: "Missing required field: orderId",
});

// Process dead-letter queue
const dlqReceiver = client.createReceiver("my-queue", { subQueueType: "deadLetter" });
const dlqMessages = await dlqReceiver.receiveMessages(10);
for (const msg of dlqMessages) {
  console.log(`DLQ Reason: ${msg.deadLetterReason}`);
  // Reprocess or log
  await dlqReceiver.completeMessage(msg);
}

Scheduled Messages

typescript
const sender = client.createSender("my-queue");

// Schedule for future delivery
const scheduledTime = new Date(Date.now() + 60000); // 1 minute from now
const sequenceNumber = await sender.scheduleMessages(
  { body: "Delayed message" },
  scheduledTime
);

// Cancel scheduled message
await sender.cancelScheduledMessages(sequenceNumber);

Message Deferral

typescript
// Defer message for later
await receiver.deferMessage(message);

// Receive deferred message by sequence number
const deferredMessage = await receiver.receiveDeferredMessages(message.sequenceNumber!);
await receiver.completeMessage(deferredMessage[0]);

Peek Messages (Non-Destructive)

typescript
const receiver = client.createReceiver("my-queue");

// Peek without removing
const peekedMessages = await receiver.peekMessages(10);
for (const msg of peekedMessages) {
  console.log(`Peeked: ${msg.body}`);
}

Key Types

typescript
import {
  ServiceBusClient,
  ServiceBusSender,
  ServiceBusReceiver,
  ServiceBusSessionReceiver,
  ServiceBusMessage,
  ServiceBusReceivedMessage,
  ProcessMessageCallback,
  ProcessErrorCallback,
} from "@azure/service-bus";

Receive Modes

typescript
// Peek-Lock (default) - message locked until completed/abandoned
const receiver = client.createReceiver("my-queue", { receiveMode: "peekLock" });
await receiver.completeMessage(message);   // Remove from queue
await receiver.abandonMessage(message);    // Return to queue
await receiver.deferMessage(message);      // Defer for later
await receiver.deadLetterMessage(message); // Move to DLQ

// Receive-and-Delete - message removed immediately
const receiver = client.createReceiver("my-queue", { receiveMode: "receiveAndDelete" });

Best Practices

  1. Use Microsoft Entra Token Credential - Use DefaultAzureCredential for local development; use ManagedIdentityCredential or WorkloadIdentityCredential for production
  2. Reuse clients - Create ServiceBusClient once, share across senders/receivers
  3. Close resources - Always close senders/receivers when done
  4. Handle errors - Implement processError callback for subscription receivers
  5. Use sessions for ordering - When message order matters within a group
  6. Configure dead-letter - Always handle DLQ messages
  7. Batch sends - Use createMessageBatch() for multiple messages

Reference Documentation

For detailed patterns, see:

© 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-typescript/skills/azure-servicebus-ts of microsoft/skills.

  • SKILL.md
  • references/error-handling.md
  • references/queues-topics.md

Open the folder on GitHubat commit d5741a1

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 Servicebus TS 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 Servicebus TS compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure Servicebus TS this skillmicrosoft/skills3.1k5 repos~1.8kAutomated safety check: PassMIT
Gemini Live API Devgoogle-gemini/gemini-skills4.3k—~4.6kAutomated safety check: PassApache-2.0
Qstash JSupstash/qstash-js269—~746Automated safety check: PassMIT
near-api-js Developer Guideinternet-court/internet-court-skill6.6k1 repos~4.1kAutomated safety check: PassCustom licence
Sasjs Adaptersasjs/core132—~2.6kAutomated safety check: PassMIT
Counterfact Replcounterfact/api-simulator170—~3.2kAutomated safety check: PassMIT

Similar skills

  • Gemini Live API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when building real-time, bidirectional streaming applications with the Gemini Live API, or migrating legacy Live models (2.0/2.5/3.1) to Gemini 3.8 Live.

    4.3k GitHub stars~4.6k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Qstash JS

    upstash/qstash-js

    Official

    Work with the QStash JavaScript/TypeScript SDK for serverless messaging, scheduling.

    269 GitHub stars~746 tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • near-api-js Developer Guide

    internet-court/internet-court-skill

    Reference for building with near-api-js v7 in TypeScript or JavaScript: accounts, keys, signing, contract calls, tokens, unit conversion and meta-transactions on NEAR.

    6.6k GitHub starsUsed in 1 repo~4.1k tokens
    Backend & APIsAuto-check passed
  • Sasjs Adapter

    sasjs/core

    Frontend/Node integration with SAS backends using @sasjs/adapter - configuring the SASjs class, the exact request() inputs and response shape, authentication, file upload, and session management.

    132 GitHub stars~2.6k tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Counterfact Repl

    counterfact/api-simulator

    Interact with Counterfact mock API server programmatically. An agent skill from counterfact/api-simulator.

    170 GitHub stars~3.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Cashu TS Migration

    shopstr-eng/shopstr

    Migrate a TypeScript/JavaScript codebase from @cashu/cashu-ts v2 to v4.

    103 GitHub stars~3.1k tokensUpdated 8 days ago
    Backend & APIsAuto-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 today
    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 Servicebus TS

What does Azure Servicebus TS do?

Build messaging applications using Azure Service Bus SDK for JavaScript (@azure/service-bus). Azure Servicebus TS is an agent skill from microsoft/skills, published by the product's own GitHub organization. Build messaging applications using Azure Service Bus SDK for JavaScript (@azure/service-bus).

When should I use Azure Servicebus TS?

Azure Servicebus TS fits situations like: implementing queues; topics/subscriptions; message sessions; dead-letter handling.

How do I install Azure Servicebus TS in Claude Code?

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

How do I install Azure Servicebus TS in Codex?

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

Can I use Azure Servicebus TS 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-servicebus-ts -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-servicebus-ts, .gemini/skills/azure-servicebus-ts, .github/skills/azure-servicebus-ts and .opencode/skills/azure-servicebus-ts in your project.

What does Azure Servicebus TS need to run?

Going by SKILL.md and its folder, Azure Servicebus TS needs the command-line tools its instructions call (npm) and credentials named AZURE_TOKEN_CREDENTIALS. Our summary lists: Node.js.

Does Azure Servicebus TS 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 Servicebus TS 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 Servicebus TS use?

Azure Servicebus TS 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 Servicebus TS use?

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

What are the alternatives to Azure Servicebus TS?

Skills that share tags, products or a category with Azure Servicebus TS: Gemini Live API Dev (google-gemini/gemini-skills, 4.3k stars), Qstash JS (upstash/qstash-js, 269 stars), near-api-js Developer Guide (internet-court/internet-court-skill, 6.6k stars) and Sasjs Adapter (sasjs/core, 132 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure Servicebus TS?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,097 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.