I Have an Azure Cloud Function that pushes messages to a queue under a Azure Service Bus namespace. The receiver for this queue is a .NET Framework 4.6.1 application which has the Service Bus SDK[Azure.Messaging.ServiceBus] installed. Problem is that the code sample references online are mostly for console applications which has Program.cs. My application has a Global.asax file, i believe, as the startup file.
So I referred the code from here. Placed it in Global.asax but not able to receive messages.
What has been tried is, I've created a console application on the same VM as the one which has the application mentioned above. Installed the SDK and pasted the listener code. It was able to receive messages from Service bus, which strikes off any possibilities of network misconfiguration. So most likely its the setup at .net 4.6.1 application level
Can anyone help with a sample service bus receiver/listener code?
For Queue_AccessKey string, copy the string from azure as shown below.
Use the Console application and use the below code in .Net 4.6.1 framework.
For this the NuGet "
Microsoft.Azure.ServiceBus
" version="5.2.0" targetFramework="net461” has to be installed in the project.And the below namespace has to be used in the code. using Microsoft.Azure.ServiceBus;