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