Hybrid Integration – BizTalk Server and Azure Service Bus Queues

Hybrid Integration can allow us to work and combine both on-premise and cloud integration. Moving everything to cloud might not be the best solution but making the use of hybrid integration will deliver flawless stability for enterprises that integrates data from on-premise to cloud data and guaranteeing that businesses have full benefit when going ahead.

In this example we are going to send a message on a service bus queue via Postman which will be later picked up by on-premise BizTalk Server using SB-Messaging adapter.

The only problem with the Service Bus Queue is the maximum message size depend on the pricing tier you choose. Even if you go with the premium tier – the max allowed size is 1024 KB and for the Premium tier you end of paying a lot.

HybridIntegrate

Steps we would be carrying out are as follows –

  • Create Azure Service Bus and Queue
  • Create a Policy (Manage, Listen, Send) messages from Queue
  • Configure BizTalk receive port with SB-Messaging adapter
  • .Net code to generate sasToken
  • Test – Postman

Create Azure Service Bus & Queue

Login to you Azure portal and create service bus namespace.

HybridIntegrate1

Once the namespace is created navigate to the blade and under entities select Queues and create one.

HybridIntegrate2

Create Azure Shared Access Policies

Navigate to the Queue created and click on – Shared access policies and create one. We will be using the same policy for managing both receive and send. Once the policy is created you will have a primary and secondary connection strings. Copy the Primary key and connection string as we would be needing it for BizTalk port configuration.

HybridIntegrate3

Configure BizTalk receive port with SB-Messaging adapter

HybridIntegrate4

In the Authentication tab select Shared Access Signature and specify Shared Access Key Name and Shared Access Key.

HybridIntegrate5.JPG

For test purpose create a Send port which subscribes to the above receive port and save the messages to a file location.

.Net code to generate sasToken

Create a simple .net console application to create a sasToken which will be used in our Postman header property Authorization key.

I have used the code for sasToken from the Microsoft link.

HybridIntegrate6.JPG

Test – Postman

Now the final step is configuring postman with necessary URL and header properties and trigger message which will land on service bus queue. This message will be picked by BizTalk SB-Messaging adapter and send to a file share location.

In Header specify Authorization and paste the value we generated from above code. We are sending a json message as the input, so specify the Content-Type as application/json.

INPUT –

HybridIntegrate7.JPG

OUTPUT – 

HybridIntegrate9

You can also monitor your Service Bus from the overview tab for incoming / outgoing messages and no of successfully and failed request.

HybridIntegrate10.JPG

 

Advertisements

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s