This post will cover a problem that many people will run into when using the BizTalk 2013 SB-Messaging adapter to access Azure Service Bus queues.

First of all I wish to claim that Azure Service Bus is a really good way to enable cheap, asynchronous, highly available communication for a corporation and its external partners. Microsoft guarantees for a ridiculously low sum that the queues are available almost 24/7. Then you can have BizTalk picking up and posting messages from resources inside your organization without any DMZ or firewall issues. You can also update your BizTalk servers without affecting the service for your partners. I might return to this pattern in an architecture based post in the future.

“For Service Bus Queues and Topics, we guarantee that at least 99.9% of the time, properly configured applications will be able to send or receive messages or perform other operations on a deployed Queue or Topic” – SLA for Service Bus

But a common mistake (actually a shortcoming of the adapter) that people usually do once which will prevent BizTalk form accessing the queues and will leave you confused with an error message in BizTalk similar to

The receive location “Receive Location1” with URL “sb://<yournamespace>.servicebus.windows.net/<yourqueue>” is shutting down. Details:”System.InvalidOperationException: This client is not supported for a partitioned entity. The client version should be greater or equal than version ‘2013-10’. 320797da-ce36-4573-ae99-1877994ce991_G20 —> System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: This client is not supported for a partitioned entity. The client version should be greater or equal than version ‘2013-10’. 320797da-ce36-4573-ae99-1877994ce991_G20

Fortunately this is very easy to fix once you are aware of it but it will require you to recreate the queue.

Create a BizTalk enabled queue in the Azure Portal

The first thing, which is actually the key, is NOT to quick create the queue. Choose Custom Create (which I anyway recommend so that you are aware of some of the parameters that you can configure on the queue.

The first step of the Custom Create is really just to name the queue. (no screenshot)

But in the second step of the wizard you should make sure that you uncheck the Enable Partitioning checkbox.

And now you have a BizTalk SB-Messaging enabled queue and should not receive the message from the top of this post.

Create BizTalk enabled queue with Service Bus API

If you are a big corporation with many queues you probably have (or should have) automated queue creation. Below is an example of how you can create a BizTalk enabled queue with the Service Bus API. Note the EnablePartitioning = false part. I intentionally added some code to add a partner access key so the partner can access the queue.