Giter Club home page Giter Club logo

servicebus-postman-collection's Introduction

Service Bus - Postman client

This is a Postman boilerplate collection to use Azure Service Bus REST API as detailed in the official docs.

You'll find the Azure CLI instructions below to setup the required resources that Postman will need. You can also create the resources with the Azure Portal and just use the Postman collection.

Setup

Postman will need an App Registration to authenticate and send messages to Service Bus using access tokens.

Steps to setup the Postman client:

  1. Create an App Registration on Azure AD with a client secret + Service Principal
  2. Assign the desired Service Bus RBAC to the Service Principal.
  3. Configure the Postman collection to connect to Azure AD and Service Bus.

Identify the values marked as {...} that need to be replaced.

1 - Create the App Registration

# Creates an app registration (ex: postman-servicebus-dev)
az ad app create --display-name "{name}" --query appId -o tsv

# Create a secret ---> πŸ’‘ save the output for later
az ad app credential reset --append --display-name postman --id "{APP ID}"

# Create the service principal
az ad sp create --id "{APP ID}" --query id -o tsv

2 - Assign permissions for the Service Principal to send messages to Service Bus

# Get the Service Bus resource id
az servicebus namespace show -n "{SERVICEBUS NAMESPACE}" -g "{RESOURCE GROUP}" --query id -o tsv

# Assign the permission
az role assignment create --assignee "{SERVICE PRINCIPAL ID}" \
  --role 69a216fc-b8fb-44d8-bc22-1f3c2cd27a39 \
  --scope "{SERVICE BUS RESOURCE ID}"

ℹ️ Optionally, you can add Azure Service Bus Data Receiver or even Azure Service Bus Data Owner depending no your needs. Check out Azure RBAC built-in roles.

3 - Configure Postman & Send messages

Download and import both the Collection and the Environment boilerplate files from this repository that are available under the ./postman folder.

3.1 Set the environment variables

Set the required values so Postman can authenticate and send messages. You'll add the dynamic values that were generated and your Service Bus namespace name and queues.

3.2 - Authenticate

Select the environment on Postman. First you need to authenticate and generate a token:

πŸ’‘The token will be automatically saved to the context in the {{access_token}} variable on Postman

3.3 - Send Messages

βœ… You can now send messages to Service Bus.

I've added a batch request there as well. You might want to check Service Bus REST API for more operations, options, and troubleshooting.

Contributing

Feel free to send a PR for new operations that you find useful for your use cases and complement this collection.

servicebus-postman-collection's People

Contributors

epomatti avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.