Upgrade an Microsoft Azure queue trigger from v3 (in-process) to v4 (isolated worker process)
Budget: $30 – $250 USD
I have an existing, WORKING Azure function (QueueTrigger) implemented in C#, running on version 3 of Azure functions runtime. I need to update this function's code to run on v4 or Azure runtime using .NET 7. The upgraded function needs to run in an isolated worker process (NOT in-process).
The function is an Azure Storage Queue trigger that processes items in the queue, one item at a time. Each item represents an email message to be send by Twilio SendGrid extension.
Here is the existing (v3) function code:
using SendGrid.Helpers.Mail;
using System.Text.Json;
using System.Threading.Tasks;
using Azure.Data.Tables;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using System.Text;
namespace PolTrack.CdbGetFunctionApp
{
/// <summary>
/// Processes Storage Queue items representing email messages.
/// </summary>
public static class EmailMessageQueueTrigger
{
[FunctionName("EmailMessageQueueTrigger")]
public static async Task Run(
[QueueTrigger(Constants.EMAIL_MESSAGES_QUEUE, Connection = Constants.PT_STORAGE_ACCOUNT)] string emailMessageJson,
[SendGrid()] IAsyncCollector<SendGridMessage> messageCollector, ILogger log)
{
JObject emailObject = JObject.Parse(emailMessageJson);
var message = new SendGridMessage();
message.AddTo((string)emailObject[Constants.EMAIL_TO_PROP], (string)emailObject[Constants.EMAIL_TO_NAME_PROP]);
message.AddContent(Constants.MIME_TYPE_HTML, (string)emailObject[Constants.EMAIL_BODY_PROP]);
message.SetFrom(new EmailAddress((string)emailObject[Constants.EMAIL_FROM_PROP], (string)emailObject[Constants.EMAIL_FROM_NAME_PROP]));
message.SetSubject((string)emailObject[Constants.EMAIL_SUBJECT_PROP]);
await messageCollector.AddAsync(message);
}
}
}
public class OutgoingEmail
{
public string To { get; set; }
public string From { get; set; }
public string Subject { get; set; }
public string Body { get; set; }
}
Project deliverables:
1. The C# source code of the function upgraded to run on V4 of Azure functions runtime in isolated worker process. Feel free to replace constants Constants.* values with your own placeholders.
2. Instructions (changes to configurations settings, etc.) for using the new version of the function in my Azure functions app (V4 runtime, .NET7, isolated worker process).
The function is an Azure Storage Queue trigger that processes items in the queue, one item at a time. Each item represents an email message to be send by Twilio SendGrid extension.
Here is the existing (v3) function code:
using SendGrid.Helpers.Mail;
using System.Text.Json;
using System.Threading.Tasks;
using Azure.Data.Tables;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using System.Text;
namespace PolTrack.CdbGetFunctionApp
{
/// <summary>
/// Processes Storage Queue items representing email messages.
/// </summary>
public static class EmailMessageQueueTrigger
{
[FunctionName("EmailMessageQueueTrigger")]
public static async Task Run(
[QueueTrigger(Constants.EMAIL_MESSAGES_QUEUE, Connection = Constants.PT_STORAGE_ACCOUNT)] string emailMessageJson,
[SendGrid()] IAsyncCollector<SendGridMessage> messageCollector, ILogger log)
{
JObject emailObject = JObject.Parse(emailMessageJson);
var message = new SendGridMessage();
message.AddTo((string)emailObject[Constants.EMAIL_TO_PROP], (string)emailObject[Constants.EMAIL_TO_NAME_PROP]);
message.AddContent(Constants.MIME_TYPE_HTML, (string)emailObject[Constants.EMAIL_BODY_PROP]);
message.SetFrom(new EmailAddress((string)emailObject[Constants.EMAIL_FROM_PROP], (string)emailObject[Constants.EMAIL_FROM_NAME_PROP]));
message.SetSubject((string)emailObject[Constants.EMAIL_SUBJECT_PROP]);
await messageCollector.AddAsync(message);
}
}
}
public class OutgoingEmail
{
public string To { get; set; }
public string From { get; set; }
public string Subject { get; set; }
public string Body { get; set; }
}
Project deliverables:
1. The C# source code of the function upgraded to run on V4 of Azure functions runtime in isolated worker process. Feel free to replace constants Constants.* values with your own placeholders.
2. Instructions (changes to configurations settings, etc.) for using the new version of the function in my Azure functions app (V4 runtime, .NET7, isolated worker process).