Matt Ruwe
Matt Ruwe

Reputation: 3416

Access error trying to create Azure service bus queue

I'm running the following code in a simple console application that has the latest version of the WindowsAzure.ServiceBus NuGet package installed:

        var connectionString = "Endpoint=sb://<servername>/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=<SharedAccessKey>";
        var queueName = "TestQueue";

        var ns = NamespaceManager.CreateFromConnectionString(connectionString);

        if (!ns.QueueExists(queueName))
            ns.CreateQueue(queueName);

And receiving the following error:

System.UnauthorizedAccessException was unhandled
  HResult=-2147024891
  Message=The remote server returned an error: (401) Unauthorized. InvalidSignature: The token has an invalid signature. TrackingId:<GUID>_G30, SystemTracker:<MyQueue>.servicebus.windows.net

I tried a lot of different things to attempt to fix it including dropping and recreating the entire namespace. I've also verified that the SharedAccessKey has the proper claims (i.e. Manage).

enter image description here

Update

After coming back in the morning to continue troubleshooting this problem, it has mysteriously started working, so I guess the question has changed to, what happened here? The code didn't change. The key didn't change. (Confused!)

Upvotes: 2

Views: 1231

Answers (1)

Sean Feldman
Sean Feldman

Reputation: 26057

The error you've got with TrackingId:<GUID>_G30 indicates an issue on the gateway MSFT support team should be able to help with. Namespace management operations are going over HTTPS, I assume you have that opened, i.e. nothing is blocking it. So my bet would be to talk to Azure support, provide them with the TrackingId to figure out why the gateway turned your request down.

Upvotes: 2

Related Questions