Skip to content

Service Bus - Peek Queues, Manage Dead-Letter Messages from Terminal

The Service Bus view lets you browse namespaces, queues, and topics. You can peek messages (read-only) and then optionally lock and manipulate dead-letter messages — requeue them to the active queue, move them to a different target, or complete them outright.

Common tasks this replaces:

  • az servicebus commands chained together to peek and parse messages
  • Opening Azure Portal’s Service Bus Explorer to check dead-letter queues
  • Writing scripts to requeue or clean up DLQ messages
  • Manually counting message depths across multiple queues

The view uses miller-columns that grow as you drill in:

NamespacesEntitiesSubscriptions (topics only) → Active/DLQMessagesPreview

  • Entities are queues and topics for the selected namespace.
  • Subscriptions only appears when you’ve selected a topic.
  • Active/DLQ is a two-item picker where you choose which queue type to browse.
  • Messages is empty by default — peek is a deliberate action, not automatic.
  • Preview opens when you press Enter on a message.

Not all panes are visible at once — the view shows a parent, focused, and child pane and shifts as you navigate.

Entities are queues and topics within a namespace. Press Enter on a namespace to load its entities.

For queues, pressing Enter takes you to the Active/DLQ picker.

For topics, pressing Enter shows the topic’s subscriptions. Select a subscription to reach the Active/DLQ picker.

Press s (or aSort entities) on the entities pane to open the sort picker:

  • Default order
  • Name (ascending / descending)
  • Active messages (ascending / descending)
  • Dead letters (ascending / descending)

The action menu also offers Filter: only with dead letters to hide entities with zero DLQ messages, and Show all entities to clear the filter. The filter is action-menu-only — there is no dedicated shortcut.

After selecting Active or DLQ, the messages pane is empty. Peek is a deliberate action — no network round-trip happens until you ask for it.

Open the action menu (a) from the messages pane and choose one of:

  • Peek active / DLQ messages — fetch the first batch (label says active or DLQ based on which queue is open)
  • Peek more active / DLQ messages — append another batch, continuing from where the previous peek left off
  • Peek active / DLQ messages (fresh) — discard the current batch and peek from the start
  • Clear messages — drop the local snapshot without peeking

Press Enter on a peeked message to open the preview pane with the full message body. You can select text in the preview with the mouse to copy it.

KeyAction
EnterView message detail
h / Esc / BackspaceClose message preview
SpaceMark / unmark message
v / VEnter visual-line mode to select a range
oSwap anchor while in visual mode
EscCommit visual selection as marks

To actually change DLQ state, open the action menu and choose Receive DLQ messages (with lock). This receives up to 50 messages in a single 30-second call — often fewer, depending on the broker — and holds locks on them. The pane title changes to DLQ Locked (N) to indicate the mode. If nothing locks (count is 0), only Abandon all is useful.

Once locked, the action menu offers:

  • Requeue N message(s) — send each locked message to the active queue, then complete it from the DLQ
  • Move N message(s) to… — send each locked message to a different target queue or subscription (picker opens), then complete from DLQ
  • Complete N message(s) (remove from DLQ) — complete without re-sending
  • Abandon all (release locks) — release all locks, messages stay in DLQ

N is the number of marked messages, or 1 (the cursor) if nothing is marked. Use Space or visual-line mode to mark messages before opening the action menu.

For larger jobs, skip the per-message lock flow and use the action menu on the queue type pane (Active/DLQ picker). Both entries only appear when the selected queue type has at least one message.

  • Requeue all DLQ messages (N) — drains the entire DLQ to the active queue. Receives in batches of 50, sends each, completes each, repeats until empty.
  • Move all active messages to… (N) / Move all DLQ messages to… (N) — same but sends to a different target you pick. The label includes whether it’s the active or DLQ queue based on which one you have open.

These are safer than looping locally because they lock each batch before processing, and recover if interrupted (unprocessed messages retain their original delivery count).

Both bulk operations are bounded by a 120-second window. Very large queues may complete partially — the result notification reports how many succeeded before the deadline.

Picking Move … to… opens a target picker. The first phase lists entities in the current namespace plus a synthetic Other namespace... entry; selecting that opens a second phase to pick a different namespace, then entities within it.

Cross-namespace moves require AAD with Send rights on the target — there’s no connection-string fallback for the target side, so an explicit “Send claim required” error means the credential doesn’t have the right role.

Long-running bulk operations show progress through a spinner and resolve with a notification when they finish. The app-level Activity overlay (F) tracks in-flight cache fetches across all tabs, but Service Bus requeue/move operations are not currently wired into it — watch the notifier and pane status instead.

Mark individual messages with Space, or use visual-line mode (v) to select a range. Marked messages can be operated on in bulk through the action menu.

Visual-line mode behaves like vim:

  1. Press v to anchor at the current message.
  2. Move the cursor to extend the selection; press o to extend from the other end.
  3. Press v again or Esc to commit the range to marks.

Press K to toggle the inspect strip, which shows a fixed set of fields for the current selection: namespace (name / subscription / resource group / FQDN), entity (name / kind / active / DLQ counts), topic subscription (name / parent topic / active / DLQ counts), or message (ID / enqueued time / body preview).

Service Bus tabs participate in the cross-tab jump list. Pressing Ctrl+O jumps back to your previous navigable position (including a different tab); Ctrl+I goes forward. See Navigation for details.

Press a to open the action menu. Available actions depend on which pane is focused.

ActionDescription
Sort entitiesSort by name, active count, or dead-letter count
Show all entities / Filter: only with dead lettersToggle the DLQ entity filter

Both entries only appear when the selected queue type has count > 0.

ActionDescription
Requeue all DLQ messages (N)Requeue every dead-letter message back to the active queue
Move all active / DLQ messages to… (N)Move all messages of the open type to a different queue or subscription
ActionDescription
Peek active / DLQ messagesFetch a batch of messages (read-only); label depends on the open queue
Peek more active / DLQ messagesAppend another batch
Peek active / DLQ messages (fresh)Discard current batch and re-peek
Clear messagesDrop the local snapshot
Receive DLQ messages (with lock)Lock messages for transactional operations (DLQ only)
Open blob in explorerCross-tab jump — shown (here and in the preview pane) when the cursor message is a Microsoft.Storage.Blob* Event Grid envelope; opens a Blob tab pre-positioned on that blob
Toggle markMark or unmark the current message
Toggle visual line selectionEnter or exit visual-line mode
ActionDescription
Requeue N message(s)Send marked messages to the active queue and complete from DLQ
Move N message(s) to…Send marked messages to a different target and complete from DLQ
Complete N message(s) (remove from DLQ)Complete marked messages without re-sending
Abandon all (release locks)Release all held locks without modifying messages
Toggle markMark or unmark the current message
Toggle visual line selectionEnter or exit visual-line mode
ActionDescription
RefreshReload the current scope (hidden from message preview)
Toggle details panelShow or hide the inspect strip (hidden from message preview)
Change subscriptionOpen the subscription picker
Open theme pickerOpen the theme picker (standalone only)
Toggle helpOpen or close the help overlay (standalone only)

The Message preview pane offers only the Open blob in explorer entry (when the cursor message is an Event Grid blob event) plus subscription / theme / help — refresh and inspect are intentionally hidden because they have no effect on a single-message view.

KeyAction
Tab / Shift+TabCycle pane focus
Enter / lOpen / drill in
h / LeftGo back
/Filter focused pane
Ctrl+D / Ctrl+UHalf-page scroll
aAction menu
sOpen sort picker (entities pane)
SpaceToggle mark (messages pane)
v / VVisual-line selection
oSwap visual anchor
EscExit visual mode (commits selection) / close preview / cancel filter or overlay
KToggle inspect panel
SSwitch subscription
rRefresh — re-fetches entity counts from the queue-type pane; re-peeks from the messages pane (unless DLQ is locked)
FActivity overlay (app-level — currently shows cache fetches only)
Ctrl+O / Ctrl+IJump back / forward in history