Reputation: 1
I create an Azure Function of type Service Bus with theme, from Visual Studio 2022 Community Edition using C#, I configure the connection with a full permissions endpoint.
When trying to do debugging, it doesn't do anything and in the output window, after loading the symbols, sometimes it just puts an error, but other times it doesn't put anything.
The service bus contains at least 5 messages with 2 subscriptions, one with the session enabled and the other with the session disabled.
The error that sometimes gets displayed in the output window is:
Exception thrown: 'Azure.RequestFailedException' in System.Private.CoreLib.dll
I have used both the libraries with the version that the project is created (Microsoft.NET.Sdk.Functions 4.1.1 and Microsoft.Azure.WebJobs.Extensions.ServiceBus 4.3.0), even using the latest versions of these components (Microsoft. NET.Sdk.Functions 4.2.0 and Microsoft.Azure.WebJobs.Extensions.ServiceBus 5.9.0)
This happens to me both with subscriptions with the session option enabled or disabled.
Code:
Result:
I have tried all combinations of versions of Microsoft.NET.Sdk.Functions and Microsoft.Azure.WebJobs.Extensions.ServiceBus. I have Azure Functions with Service Bus working without problem with Net 3.1, but with Net 6 it just won't let me.
Upvotes: 0
Views: 1016
Reputation: 8541
I have created a servicebus topic trigger azure function and tried to fetch message details which exists in the service bus topic.
I was also facing the same issue as you mentioned that couldn't see anything in console (output window).
Later, I added ILogger
to my code as shown below:
I could see the message details in console:
Exception thrown: 'Azure.RequestFailedException' in System.Private.CoreLib.dll
This seems to be because of the failure in the request to the Azure Service Bus and also it happens due to network issues.
Check if the below steps help to fix the issue:
verify if the service bus connection string in local.settings.json
is given correctly and has full permissions to the Service Bus namespace.
Check if the messages are in the correct format and are being sent to the topic or not. If there is any problem with processing the messages, it will move to dead-letter
queue.
Dead-letter Queue holds the messages, which have any problem in processing. Remove or try to re-process those messages to subscription.
Note: Refer to the MSdoc to send and receive the messages from service bus topic.
Upvotes: 0