Configuring Azure Service Bus account in webMethods.io Integration Workflow
Tags: azure, integration, tutorial, servicebus
Published: 2021-09-09 14:09:29

---
title: Configuring Azure Service Bus account in webMethods.io Integration Workflow
published: true
date: 2021-07-30 11:42:16 UTC
tags: #azure, #integration, #tutorial, #servicebus
canonical_url: https://tech.forums.softwareag.com/t/configuring-azure-servicebus-account-in-webmethods-io-integration-workflow/243274
---



## Configure Account on Azure Portal

1. On the home page of the Azure portal, click on **Create a resource**  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/4/3/438df347859d586928688d98607f0dea10a4f1d7.png)
2. 
On the next page search for **Service Bus** and open the service
3. Click on **Create** button to create new **Service Bus** resource  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/f/bfb1aca4673e6f7b6e863cfed5ed0cbedc3c5b93.png)
4. Fill in the required details and click on **Review + create**
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/f/7fb3d143cd6668bd3ec42b26af0c892378022dae.png)
Note: For details on pricing follow the [link](https://azure.microsoft.com/en-in/pricing/details/service-bus/).
5. On the next screen click on **Create** button
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/b/1/b14a458ec80366ce1bb46c73e89add942a51cd27_2_413x500.png)
6. Once the resource is created, we need to create the app.
Navigate to **Azure Active Directory** and click on **App registrations**
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/4/b/4bcd640c45054027fbc88edf9cdb893a549b9fc2_2_196x500.png)
7. Click on **Add** to create a new app
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/8/e8bb188d0abbaf40cfcb82f5d21e1a7a1078b7b3.png)
8. 
Fill in the details as below and click on **Register** :
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/4/7/47880c6d2daed874ff0b1eed45a02695fbdc4e64.png)
9. Copy **Client ID, Object ID** and **Tenant ID** for later use. Then Click on **Add a certificate or secret**
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/2/3/235c22a770b3556ba164022472face193630fffc.png)
10. Click on **New client secret** then add a **Description** and select the appropriate option for **Expires.**
Click on **Add** button
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/8/e8c06e3a796a9384ec7b8ce7d25104b994b82ca9.png)
11. Copy **Value** and **Secret ID**
We will be using **Value** as our **Client secret**  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/2/c/2cfbf41b2ce1c269ce726ac884b2c1003553f027.png)
12. Now we need to configure proper permissions for this app to access the **service bus** resource.
Click on **Overview->View API permissions**
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/c/5/c59af0f6d1e9ac5cfa88e8dc0fcf8efbd6e39917.png)
13. Click on **Add a permission,** then **APIs my organization uses** and search for **Microsoft.ServiceBus**  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/5/9/59aa9461e89f576036e0c18f9dc74b6c0b41369c.png)
Click on **Add permissions** button
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/8/9/89034e3c21e6bc5653170128d0478a2c017f0eb2.png)
14. Click on **Grant admin consent for …** Click on **Yes.**
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/6/a/6a6d604615dcf477c4d6a26b8f21cf22b648c005.png)
On successfully granting the consent, you will get a success message on the screen  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/2/0/20ba8ad5c1dcc22e4e7bec6357d9e8f6c567a32b.png)

## Generate Refresh Token
1. Update below URL with your **TenantID** and ClientID and paste the url on browser
`https://login.microsoftonline.com/<TenantID>/oauth2/authorize?response_type=code&prompt=login&redirect_uri=https://www.google.com/&client_id=<ClientID>`
Follow on screen authentication process and once authentication is complete you will get response back on the browser address bar.
The response will look like this:
`https://www.google.com/?code=\<AuthCode>&session_state=\<SessionState>`
AuthCode is set of alphanumeric character of length ~750 chars. Copy the auth code for future use.
2. Create postman collection as below:  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/1/d/1d4b3d81b87b966d25002fb26107fd20d8cb7082.png)
```
URL: `https://login.microsoftonline.com/<TenantID>/oauth2/token`

client_id: <Client ID>

grant_type: authorization_code

code: <Auth code copied in above step>

redirect_uri: https://www.google.com/

resource: https://servicebus.azure.net

client_secret: <Client secret>
```
In response you will get Access token and Refresh Token. Access token will be valid for 30 minutes, but Refresh Token can be used later to regenerate access token.



## Add account on wmio

1. To Add a new account, navigate to your project on **wmio,** click on **connectors** tab and search for **Microsoft Azure Service Bus,** select Custom OAuth and click on **Next**.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/0/3/039ebaa2b9ba2764d61313956dd44f61bf8d92d2.png)
2. Fill in all the required fields:
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/a/0/a0a1c01cb95c209f87e08d99cea36b6a4020e535_2_339x500.png)
```
Server Url: `https://<resource_name>.servicebus.windows.net`
Refresh Url: `https://login.microsoftonline.com/<TenantID>/oauth2/token`
```
Once the connection is created, we can test an operation by creating a workflow or flow service.

## Simple Example

1. In this example we will send a simple message to a service bus queue already available in Azure portal (Alternatively, we can create a queue/topic using predefined operations)
Search for Azure servicebus connector and drag & drop to the editor.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/2/3/23133f06c26c8c0e716d62c6aba0ed63cf522bcf.png)
2. Open settings for the connector and fill in the details as below, click Next.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/4/b/4b40a1318f6d878dbf35aedcfa95397acc3d9a0e_2_428x500.png)
3. Add **path** and **body** as below
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/c/7/c782ecc6695625e8efe9d9801999131a33fca212.png)
4. Click on next, then done and save the workflow. Click on the Run button.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/6/f/6fc35415e7f51b17e9c5b38cdaf627a305339ecb.png)

Response:

![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/5/d/5d318ee2c05ed41253220d85037eb9963b37298f.png)


[Read full topic](https://tech.forums.softwareag.com/t/configuring-azure-servicebus-account-in-webmethods-io-integration-workflow/243274)