title: MassTransit 3 with Azure Service Bus creating queues
body: <p>I am in the process of converting an application from using MT3 with RabbitMQ into using Azure Service Bus and MassTransit isn't configuring the queue the same way in Azure as it does with RMQ, and with the documentation being on the light side (<a href="http://docs.masstransit-project.com/en/latest/overview/publishing.html#routing-on-azure-service-bus" rel="nofollow" title="here">here</a>) I wanted to see if anyone else has solved this</p>
  
  <p>I am using MT 3.4 and Microsoft.ServiceBus 3.0 for the TokenProvider, I have a utility class which creates the bus (following this <a href="http://masstransit.readthedocs.io/en/master/configuration/transports/azure.html" rel="nofollow" title="example">example</a>):</p>
  
  <pre><code>    public static IBus CreateBus()
      {
          var busControl = Bus.Factory.CreateUsingAzureServiceBus(sbc =&gt;
          {
              var host = sbc.Host(new Uri("sb://&lt;sbname&gt;.servicebus.windows.net/"), h =&gt;
              {
                  h.OperationTimeout = TimeSpan.FromSeconds(5);
                  h.TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider("&lt;KeyName&gt;", "&lt;Key&gt;");
              });
  
              sbc.ReceiveEndpoint(host, "command_queue", ep =&gt;
              {
                  ep.SubscribeMessageTopics = true;
                  ep.UseRetry(Retry.Incremental(5, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(5)));
              });
          });
  
          return busControl;
      }
  </code></pre>
  
  <p>I have a Web API controller which uses the bus to publish commands to the queue:</p>
  
  <pre><code>[RoutePrefix("customer")]
  public class CustomerController : ApiController
  {
      private readonly IBus _serviceBus;
  
      public CustomerController()
      {
          _serviceBus = AzureServiceBusUtils.CreateBus();
      }
  
      [HttpPost, Route("register")]
      public async Task&lt;HttpResponseMessage&gt; Register()
      {
          var command = JsonConvert.DeserializeObject&lt;RegisterNewCustomerCommand&gt;(Encoding.ASCII.GetString(Request.Content.ReadAsByteArrayAsync().Result));
          await _serviceBus.Publish(command);
          return Request.CreateResponse(HttpStatusCode.OK);
      }
  }
  </code></pre>
  
  <p>The RegisterNewCustomerCommand is just a simple Name, Address, etc. C# class:</p>
  
  <pre><code>namespace AZSB.Commands
  {
      public class RegisterNewCustomerCommand
      {
          public string Name { get; }
          ...
          public RegisterNewCustomerCommand(...) {...}
      }
  }
  </code></pre>
  
  <p>Now when I fire a message through, a topic is created on Azure (AZSB.Commands/RegisterNewCustomerCommand) but this isn't linked as I would expect to the command_queue, and to add to it, when I click on the topic within the Azure portal, the details panel just hangs (so i can't manually configure it to a manually created queue) </p>
  
  <p>Am I missing something?
  Alastair</p>