I have created a service bus topic (my-topic) in my Azure account. I have created a listen only rule (listen_rule) on that topic, and also a subscription to that topic (my-subscription), for my code to trigger on.
How do I add that specific subscription/rule to the [ServiceBusTrigger]
?
In app.config I have this configuration section:
<add key="MySubscription" value="my-subscription" />
<add key="MyTopic" value="Endpoint=sb://XXXXXXX.servicebus.windows.net/;SharedAccessKeyName=listen_rule;SharedAccessKey=XXXX=;EntityPath=my-topic"/>
In my code I have:
public async Task ProcessMyMessageAsync(
[ServiceBusTrigger("%MyTopic%", "%MySubscription%")]
BrokeredMessage brokeredMessage)
This throws an exception:
The entity path/name 'Endpoint=sb://XXXX.servicebus.windows.net/;SharedAccessKeyName=listen_rule;SharedAccessKey=XXXX=;EntityPath=topic' exceeds the '50' character limit.
I've found lots of examples on the web where there is a generic AzureWebJobsServiceBus
connection string, but that gives access to the whole service bus, I want to lock it down to this particular topic/rule.
p.s. I'm using .NET framework 4.5.2 (yeah, I know, it's an old application), and Microsoft.Azure.WebJobs.ServiceBus 2.0.0.
p.p.s. Ideally, I'd like to specify the whole subscription in one configuration line if possible.