Skip to content

Migrate Azure Functions to isolated worker model for .NET 8#70

Merged
benCoomes merged 3 commits intomainfrom
copilot/fix-assembly-load-errors
Feb 1, 2026
Merged

Migrate Azure Functions to isolated worker model for .NET 8#70
benCoomes merged 3 commits intomainfrom
copilot/fix-assembly-load-errors

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

Azure Functions were failing to load in production with Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0'. The in-process model is deprecated and incompatible with .NET 8 in Azure Static Web Apps.

Changes

Project Configuration

  • Replace Microsoft.NET.Sdk.Functions with isolated worker packages:
    • Microsoft.Azure.Functions.Worker
    • Microsoft.Azure.Functions.Worker.Sdk
    • Microsoft.Azure.Functions.Worker.Extensions.Http
  • Add <OutputType>Exe</OutputType> to run as console app

Runtime Entry Point

Created Program.cs:

var host = new HostBuilder()
    .ConfigureFunctionsWebApplication()
    .Build();
host.Run();

Function Signatures

Converted all functions from in-process to isolated worker model:

Before:

public static class GetActivityCount
{
    [FunctionName("ActivityCount")]
    public static async Task<IActionResult> Run(
        [HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req,
        ILogger logger)
    {
        var value = req.Query["param"];
        return new OkObjectResult(count);
    }
}

After:

public class GetActivityCount
{
    private readonly ILogger _logger;
    
    public GetActivityCount(ILoggerFactory loggerFactory) 
        => _logger = loggerFactory.CreateLogger<GetActivityCount>();

    [Function("ActivityCount")]
    public async Task<HttpResponseData> Run(
        [HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequestData req)
    {
        var query = HttpUtility.ParseQueryString(req.Url.Query);
        var value = query["param"];
        
        var response = req.CreateResponse(HttpStatusCode.OK);
        await response.WriteAsJsonAsync(count);
        return response;
    }
}

Updated Components

  • 5 function handlers: Echo, GetActivityCount, GetAthlete, TokenExchange, SubscriptionWebhook
  • StaticWebAppsAuth: Updated to parse headers from HttpRequestData
  • ErrorHandler: Returns HttpResponseData instead of IActionResult
Original prompt

This section details on the original issue you should resolve

<issue_title>Remaining 'cannot load file or assembly' problems.</issue_title>
<issue_description>Equipper is no longer able to load the Functions to handle API requests. The responses are 404s. The following is an example log for the 'ActivityCount' function. Other functions similarly fail to load.

The 'ActivityCount' function is in error: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

Please research the requirements for running .net 8 API functions in an azure static web app. If you need additional information about the Equipper production runtime that cannot be determined from the source code, ask so that I can find it for you.

Following research, implement the necessary changes to allow the functions to start and serve requests.

</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 1, 2026 02:03
Co-authored-by: benCoomes <14079296+benCoomes@users.noreply.github.com>
Co-authored-by: benCoomes <14079296+benCoomes@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix remaining 'cannot load file or assembly' problems Migrate Azure Functions to isolated worker model for .NET 8 Feb 1, 2026
Copilot AI requested a review from benCoomes February 1, 2026 02:10
@benCoomes benCoomes marked this pull request as ready for review February 1, 2026 02:11
@github-actions
Copy link

github-actions bot commented Feb 1, 2026

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-ocean-0a357fa0f-70.eastus2.azurestaticapps.net

@benCoomes benCoomes merged commit 3690380 into main Feb 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remaining 'cannot load file or assembly' problems.

2 participants