title: List all Azure servicebus subscriptions in a ServiceBus namespace
body: <p>I am migrating my project from the <code>WindowsAzure.ServiceBus</code> to the new <code>Microsoft.Azure.Servicebus</code> NuGet package.</p>
  
  <p>The problem is that I cannot find a way to list all my current topics/subscriptions in my servicebus namespace.</p>
  
  <p>This is the piece of code I used before with the old NuGet package:</p>
  
  <pre><code>var namespaceManager = NamespaceManager.CreateFromConnectionString("ServiceBusConnectionString");
  
  foreach (var topic in await namespaceManager.GetTopicsAsync())
  {
      foreach (var subscription in await namespaceManager.GetSubscriptionsAsync(topic.Path))
      {
          //do something
      }
  }
  foreach (var queue in await namespaceManager.GetQueuesAsync())
  {
      //do something
  }
  </code></pre>
  
  <p>Edit: The latest version has support for listing all topics, subscriptions and queues.</p>
  
  <pre><code>var managementClient = new ManagementClient("ServiceBusConnectionString");
  
  foreach (var topic in await _managementClient.GetTopicsAsync())
  {
      foreach (var subscription in await _managementClient.GetSubscriptionsAsync(topic.Path))
      {
          //do something
      }
  }
  </code></pre>