0

I created a shared access policy with only send permission for a service bus queue. I used to send messages from web role to service bus queue using service bus connection string. Now the requirement is , instead of using service bus connection string I need to create a shared policy for service bus Queue with only send permission and use that policy for sending messages to service bus from web role.

I need to do this in c#, but I do not know how to create connection string for service bus queue with shared access policy. Kindly explain how to get Service bus Queue Shared access policy connection string in c#.

Vinod
  • 929
  • 1
  • 16
  • 42
Kondreddy
  • 1
  • 2

2 Answers2

1

When you add a policy at queue level, you could use the Service Bus connection string like below:

Endpoint=sb://configpoc.servicebus.windows.net/;SharedAccessKeyName=QueueListenOnlyPolicy;SharedAccessKey=<YourKey>

Here "QueueListenOnlyPolicy" will be the key of your Queue level policy.

Regards

Vinod
  • 929
  • 1
  • 16
  • 42
0

I am experiencing the same issue. When I generate SAS from the Queue level, I create a QueueClient (I tried with MessageSender as well), and it is OK, until I try to send a message. Then I get an authorization level. On the contrary, the namespace's connection string allows me to send the message. Both connection strings give the same rights.

nkalfov
  • 439
  • 5
  • 12
  • You could try the new package, which has other bugs, but this particular scenario is working. You may find it @ https://github.com/Azure/azure-service-bus-dotnet – nkalfov Dec 29 '17 at 21:44