Configuring Azure ServiceBus account in webMethods.io Integration Workflow

Configure Account on Azure Portal

Steps to follow:

  1. On the home page of the Azure portal, click on Create a resource
    image

  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

  4. Fill in the required details and click on Review + create

    image

    Note: For details on pricing follow the link.

  5. On the next screen click on Create button

  6. Once the resource is created, we need to create the app.

    Navigate to Azure Active Directory and click on App registrations

  7. Click on Add to create a new app

    image

  8. Fill in the details as below and click on Register :

    image

  9. Copy Client ID, Object ID and Tenant ID for later use. Then Click on Add a certificate or secret

    image

  10. Click on New client secret then add a Description and select the appropriate option for Expires.

    Click on Add button

    image

  11. Copy Value and Secret ID

    We will be using Value as our Client secret
    image

  12. Now we need to configure proper permissions for this app to access the service bus resource.

    Click on Overview->View API permissions

    image

  13. Click on Add a permission, then APIs my organization uses and search for Microsoft.ServiceBus
    image

    Click on Add permissions button

    image

  14. Click on Grant admin consent for … Click on Yes.

    image

    On successfully granting the consent, you will get a success message on the screen
    image

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

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 webMethods.io

  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

  1. Fill in all the required fields:

    Server Url: https://<resource_name>.servicebus.windows.net

Refresh Url: https://login.microsoftonline.com/<TenantID>/oauth2/token

Note: Please do not use authorization_code as value for the field grant_type in connection parameter. Default value for the grant_type is refresh_token. You can either leave the field blank to use the default value or provide the appropriate value based on backend documentation.

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

  1. Open settings for the connector and fill in the details as below, click Next.

  1. Add path and body as below

image

  1. Click on next, then done and save the workflow. Click on the Run button.

    image

    Response:

image