I am having problems connecting from Azure Flex Consumption Function App to Service Bus

Chris Gray 0 Reputation points
2024-11-21T12:38:58.3533333+00:00

I have a flex consumption function app plan which has service bus connection string set in its app settings, however it does not seem to be consuming messages from Service bus. The service bus we use is a standard plan and the error we get is "MaxDeliveryCountExceeded". The app has a system assigned managed identity which has access to the service bus too. With the Flex Consumption Plans I am struggling to find ways to diagnose issues.

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
653 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,250 questions
Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
240 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 5,310 Reputation points Microsoft Employee
    2024-11-22T10:41:24.2966667+00:00

    Hello @Chris Gray

    This error occurs when the maximum number of delivery attempts for a message has been exceeded. To diagnose the issue, you can try the following 5 steps:

    1. Check if the connection string for the Service Bus is correct and is set in the app settings of your Azure Function App. You can verify this by going to the Configuration section of your Function App and checking if the connection string is present.
    2. Check if the managed identity of your Function App has the necessary permissions to access the Service Bus. You can verify this by going to the Access control (IAM) section of your Service Bus namespace and checking if the managed identity has the necessary permissions.
    3. Check if the Function App is able to connect to the Service Bus by using the Service Bus Explorer tool. You can download the tool from the Azure portal and use it to connect to your Service Bus namespace. If you are able to connect and see the messages in the queue or topic, then the issue might be with your Function App.
    4. Check if the Function App is able to receive messages from the Service Bus by using the Service Bus Explorer tool. You can send a test message to the queue or topic and check if the Function App is able to receive it. If the Function App is not able to receive the message, then the issue might be with the Function App code.
    5. Check the Function App logs for any errors or exceptions related to the Service Bus connection or message consumption. You can view the logs by going to the Monitoring section of your Function App and selecting the Logs option.

    I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.