azure function not able to recieve message from servicebus

Uday Kumar 1 Reputation point
2021-08-28T23:24:30.09+00:00

I have created Azure function in MS Visual Studio which listens for events from servicebus topic.
When I published to Azure Function app. It is not even running.

It is showing the below error in azure portal

"Azure Functions runtime is unreachable"

Under Activity log I see below error:

Encountered an error (InternalServerError) from host runtime.

I am seeing below error under notificactions:

Functions runtime error
Microsoft.Azure.WebJobs.ServiceBus: Microsoft Azure WebJobs SDK ServiceBus connection string 'Endpoint=sb://hgservicebusns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;[Hidden Credential]' is missing or empty.

Can someone help me resolving this issue. It is very urgent from the delivery point of time.

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
567 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,472 questions
{count} votes

2 answers

Sort by: Most helpful
  1. MayankBargali-MSFT 69,841 Reputation points
    2021-08-30T05:24:21.71+00:00

    @Uday Kumar As per your local.settings.json you have define service bus connection string using connection parameter.
    Please make sure that you have define the same parameter in your Service Bus trigger Connection

    If there is mismatch then I do observe the same error as you have shared. The same is covered example section of the document.

    In the document example it is mentioned as ServiceBusConnection so my local.settings.json should also have ServiceBusConnection paramter define.
    public static void Run([ServiceBusTrigger("myqueue", Connection = "ServiceBusConnection")]

    In your case as you have define it as connection so your trigger should be define as below:
    public static void Run([ServiceBusTrigger("myqueue", Connection = "connection")]

    In case if you have also define AzureWebJobsServiceBus then your Connection should be empty as mentioned in configuration section. It looks like you have define both.

    Feel free to get back to me if you are still facing the isue.

    0 comments No comments

  2. Mario Galindo 1 Reputation point
    2021-11-05T20:30:46.977+00:00

    You need to define your connection string on azure portal in the FunctionApp -> Settings/Configuration section.

    0 comments No comments