Using precise code from following article:
(https ://azure .microsoft .com/en-us/documentation/articles/service-bus-dotnet-how-to-use-queues/)
var namespaceManager = NamespaceManager.CreateFromConnectionString(ConnectionString); if (!namespaceManager.TopicExists(TopicName)) { namespaceManager.CreateTopic(TopicName); }
1. Namespace created? Check
2. Shared Access Policy created w/ Manage permissions for Namespace? Check
3. Latest stable WindowsAzure.ServiceBus Library (3.1.5) installed via NuGet? Check
4. Using ConnectionString copied straight from Service Bus Management portal? Check
Still, when trying to access .CreateTopic or .CreateQueue method of namespaceManager e.g.
.CreateQueue("test"); .CreateTopic("test");
this is the result:
System.UnauthorizedAccessException was unhandled HResult=-2147024891 Message=The remote server returned an error: (401) Unauthorized. Manage claim is required for this operation. TrackingId:9283035b-1ef8-45ba-b54b-04ff8e593660_G26,TimeStamp:3/24/2016 8:58:01 PM Source=Microsoft.ServiceBus
I've tried restarting the Machine. All Updates. Deleting & Recreating SB Namespace. Using a ConnectionString w/ SharedAccessKeyName=RootManageSharedAccessKey (i.e. explicit/implicit manage permissions)...
No Joy.
I've tried creating a Topic & a Queue within the Namespace via classic management portal to see if namespaceManager could read from Namespace with
namespaceManager.GetTopics();
this is the result:
System.UnauthorizedAccessException was unhandled HResult=-2147024891 Message=The remote server returned an error: (401) Unauthorized. Manage claim is required for this operation. TrackingId:593e2f03-c2bc-418f-b337-ab5331a16729_G15,TimeStamp:3/24/2016 9:44:28 PM Source=Microsoft.ServiceBus StackTrace: Server stack trace: Exception rethrown at [0]: at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.NamespaceManager.EndGetTopics(IAsyncResult result) at Microsoft.ServiceBus.NamespaceManager.GetTopics()
Help?!