A collection of tools, shims, and facades to help make migrating Azure Functions to .NET 7 easier
You need to migrate your project to .NET 7 and Azure Functions or Azure Static Websites with .NET 7. The syntax for writing functions with C# and .NET 7 is significantly different due to the isolated model for Azure Functions.
Consider syntax like the following that works properly in Azure Functions in-process mode with .NET 6:
[FunctionName("GetClips")]
public async Task<IActionResult> GetClips(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequest req,
ILogger log)
{
string channelName = req.Form["ChannelName"];
var top = await _ClipRepository.GetTopClips(channelName, 300);
return new OkObjectResult(new ClipsPayload
{
Data = top,
TotalClips = top.Count()
});
}
There's so much I like about this method working in Azure Functions... and so much is broken in isolated mode. This library will help you apply those repairs with minimal changes to your original code.
With the 0.1 version, the above function can be adapted to this format and behave the same:
[FunctionName("GetClips")]
public async Task<HttpResponseData> GetClips(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequestData req)
{
string channelName = req.Form("ChannelName");
var top = await _ClipRepository.GetTopClips(channelName, 300);
return req.OkObjectResult(new ClipsPayload
{
Data = top,
TotalClips = top.Count()
});
}
ICollector
or IAsyncCollector
parameter to interact with an Azure Storage QueueIAsyncCollector
parameter to interact with an Azure ServiceBus Queue or Topic