0

I have a Azure Function App that process some messages from Azure Service Bus Topic. I have some messages passed to the ASB and there are messages coming under my topic's subscription. However when I run my app locally which points to that specific subscription, it still doesn't get triggered. I do have configured my app properly with all the connection string. How would you suggest to diagnose this issue?

Just for context: I have it configured in my local settings with needed parameters.

PPPP
  • 11
  • 4

1 Answers1

0
  • Check your connection property of ServiceBusTrigger attribute which should refer to ServiceBusConnectionString.
  • Now, you need to provide the same name in local.settings.json for local and app settings for azure.
  • Below is the sample code for ServiceBusTrigger with Azure Functions.

 [FunctionName("ServiceBusQueueTriggerCSharp")]                    
    public static void Run(
        [ServiceBusTrigger("myqueue", Connection = "ServiceBusConnection")] 
        string myQueueItem,
        Int32 deliveryCount,
        DateTime enqueuedTimeUtc,
        string messageId,
        ILogger log)
    {
        log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
        log.LogInformation($"EnqueuedTimeUtc={enqueuedTimeUtc}");
        log.LogInformation($"DeliveryCount={deliveryCount}");
        log.LogInformation($"MessageId={messageId}");
    }
  • Check this Microsoft Document for complete information regards to creation of Azure Function with Azure ServiceBus trigger.
SaiSakethGuduru
  • 2,218
  • 1
  • 5
  • 15
  • I did have the connection string property in my local settings and have the same name. It was working like a week ago and its not working currently. – PPPP Apr 20 '22 at 19:23
  • - Try force resyncing your triggers by hitting the refresh button. this should work if not try below steps. - Check if you can see messages in dead letter queue. - Check whether your Azure functions going idle for some time if so enable **Always On** – SaiSakethGuduru Apr 20 '22 at 19:58
  • Can you elaborate more to this? How do I force resync when I'm testing locally? Also, messages are not going to dead letter queue. It is still in Active. – PPPP Apr 20 '22 at 20:03
  • @PPPP ,Are you still facing this issue? If not, Can you let me know how you solved this? because, I am facing the same issue. – tartar May 04 '23 at 11:14