I have an Azure ServerLess C# project that I deployed out to azure with 2 functions both that should be trigger by their corresponding queues. I noticed only the first function firing but not the second one. All my settings are correct but I noticed if I reordered the functions around the top most function is the only functions that will be triggered. Is there some file I have to edit that I have edit to say there are 2 trigger functions.
Here is the main .CS file
[StorageAccount("AzureWebJobsStorage")]
public class QueueFunction
{
ICollaborationClient _collaborationClient;
ILogger<QueueFunction> _logger;
public QueueFunction(ICollaborationClient collaborationClient, ILogger<QueueFunction> logger)
{
_collaborationClient = collaborationClient;
_logger = logger;
}
[FunctionName("ParticipantQueueFunction")]
public async Task Run([QueueTrigger("%ParticipantQueueName%")] ParticipantNotificationModel participantNotificationModel, ILogger log)
{
log.LogInformation(JsonConvert.SerializeObject(participantNotificationModel, Formatting.Indented));
await _collaborationClient.PostAsync("/api/ParticipantHub", participantNotificationModel, participantNotificationModel.Headers);
log.LogInformation($"function processed participant id: {participantNotificationModel.ParticipantServiceModel.ParticipantId}");
}
[FunctionName("MessageQueueFunction")]
public async Task Run([QueueTrigger("%MessageQueueName%")] MessageNotificationModel messageNotificationModel
, ILogger log)
{
log.LogInformation(JsonConvert.SerializeObject(messageNotificationModel, Formatting.Indented));
await _collaborationClient.PostAsync("/api/notifications/SendNotifications", messageNotificationModel.MessageServiceModel, messageNotificationModel.Headers);
log.LogInformation($"function processed message id: {messageNotificationModel.MessageServiceModel.MessageId}");
}
}
I figured out my problem both methods were named the same. I just reread my question.