0

I am trying to write an Azure function that calls a webapi every time a new message is added to an azure service bus queue. However in the connections section I am only able to connect to an Azure Storage queue and not a Service Bus queue. Can someone please share how I can connect an Azure Function to a Service Bus queue and read the messages ?

w2olves
  • 2,229
  • 10
  • 33
  • 60

1 Answers1

3

The easiest way to do this is to create a new function from ServiceBusQueueTrigger-CSharp template:

enter image description here

Your existing function is probably configured for Blob Storage Queue trigger (QueueTrigger-CSharp template).

Mikhail Shilkov
  • 34,128
  • 3
  • 68
  • 107
  • When I select the "new" function on the side I don;t get any way to enter ServiceBus connection details, just Event Hub, IoT Hub or Custom?? – DoodleWalker Jun 07 '17 at 06:02
  • @DoodleWalker Make sure you are picking the right trigger type (top-left red box on my screenshot). – Mikhail Shilkov Jun 07 '17 at 06:50
  • Yep, using that exact trigger, in fact any Service bus trigger, Queue or Topic gives me the same dialog (and my colleagues), choice from Event Hub, IoT Hub or Custom. Using "Custom" and filling in connection string with own app key. Maybe they have changed something recently, does it still work ok for you? – DoodleWalker Jun 08 '17 at 07:29
  • @DoodleWalker Just checked - my portal screen still looks exactly as on the screenshot above. – Mikhail Shilkov Jun 08 '17 at 09:01