Back to plugins
Logo

Service Bus SAS Token Generator

Version 1.1.5
Install Plugin

Overview

cover.png

This Insomnia plugin generates a Shared Access Signature (SAS) Token for Azure Service Bus using environment variables, simplifying the process of sending messages to a queue or topic.

Features

  • 🔐 Securely generates SAS tokens at request-time.
  • ⚙️ Uses standard Insomnia Environment Variables.
  • ✅ Supports topics and queues.
  • 🧩 Easy to install and use as a tag in your requests.

How it works

This plugin generates a valid Authorization header with a SAS token based on your environment variables, allowing you to send messages directly to Azure Service Bus without manually crafting the token.

Environment Variables

📚 Regenerating keys.

{
  "serviceBusNamespace": "spsbusns1128",
  "serviceBusKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "serviceBusPolicyName": "SendPolicy",
  "topicName": "test", // or use "queueName",
  "ExpireTimeInSeconds": 3600 // optional
}

Note: The ExpireTimeInSeconds environment variable is optional. If not provided, it defaults to 3600 seconds, which represents 1 hour.

How to Use

Install the plugin from the Insomnia Plugin Hub.

In your POST request to the topic or queue endpoint, use the tag Generate SAS Token in the Authorization header.

Example Request Setup in Insomnia

sample-request.png

Tag Function in Use

custom-tag.png

The plugin will output the SAS token in place of the tag during request execution.

References

📚 Microsoft Docs – Service Bus SAS Authentication.

🔧 Generate SAS Token with Node.js.