Put token failed. status-code: 500 error in servicebussessionreceiver creation from azure function

Srini 1 Reputation point
2022-11-23T03:35:28.813+00:00

This error is logged occasionally in the function app logs. "An exception occurred while creating a ServiceBusSessionReceiver (Namespace '<servicebus namespace>.servicebus.windows.net', Entity path '<topic>/Subscriptions/<subscription>'). Error Message: 'Azure.Messaging.ServiceBus.ServiceBusException: Put token failed. status-code: 500, status-description: The service was unable to process the request; please retry the operation."

The function app uses managed identity to connect to the service bus.

There is no impact on the regular usage but just want to know the reason for this exception.

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

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 69,991 Reputation points
    2022-11-25T10:48:40.893+00:00

    @Srini Thanks for the confirmation. 500 error means the service was not able to process the request. So, in your case it was the PUT token request that gets failed. The issue is due to service side (function) or service bus end and the exception means that the when the request was passed for the authorization token over the link which is running as a background task/job. The Service Bus client sends refresh requests from time to time with a large enough window that failures can be retried before the current authorization expires.

    In the worst case a specific connection would be fault and the service bus client would create another new request (retry). This would be a transient issue and would recover without noticeable impact on the application. But if you observed this type of error for a long span of time then this needs to be investigated further as there could be a backend service issue and you can always engage us on support ticket. In case you don't have the support plan then you can reach out to us in Microsoft Q&A so we can investigate it further and to mitigate the issue.

    Let me know if you have any queries or concerns.

    0 comments No comments