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