Now that we have a Service Bus Queue set up, we are ready to create an Azure Function to receive the messages from the queue.
To create the function, execute the following steps:
- To do so in Visual Studio, right-click on TextEvaluation project and click on Add -> New Item -> Azure Function and add a ProcessQueue function.
- Fill in the required parameters as follows:
- Type: ServiceBusQueueTrigger
- Access rights: Listen
- FunctionName: ProcessQueue
- Connection: serviceBus
- Queue name: emailqueue (lowercase)
- Click on Create.
- Add the setting for the Service Bus connection string to the root level ListenPolicy to local.settings.json:
"serviceBus": "Endpoint=sb://textsentimentsb.servicebus .windows.net/;SharedAccessKeyName=ListenPolicy; ...