Skip to content

Smeantic-Kernal NuGets fail in Function Apps #1793

Closed

Description

Describe the bug
If you use Azure Function Apps with version 15.230531.5-preview it will work.
Every version past that gives the error in the screenshot. 0.15.320609.2-preview and onward.

To Reproduce
Just make an Azure Function App in Visual Studio 2022 as a httptrigger and import these files. After you run it, you will see the error.

Expected behavior
Needs to be able to load latest versions.

Screenshots
image

Desktop (please complete the following information):
In descriptions already, on windows 11

Activity

  1. wrharper-AASP commented on Jun 30, 2023

    @wrharper-AASP
    Author

    I believe this is the problem in the patch notes:
    Upgrade System.Text.Json and Microsoft.Extensions.Logging versions to 7.0 by Stephen Toub (@stephentoub) in #1297

  2. wrharper-AASP commented on Jun 30, 2023

    @wrharper-AASP
    Author

    I reverted changes (manually created a build) the best I could from: bc7627a until this is resolved.

  3. ericstj commented on Jun 30, 2023

    @ericstj
    Member

    cc Fabio Cavalcante (@fabiocav)
    AzureFunctions has a managed host and loads functions into the same process -- as a result the host will pin a number of the assemblies it uses since it needs to share types from those assemblies with functions and agree on the type definitions. As a result - those functions cannot upgrade the assemblies pinned by the host. It looks like Azure functions doesn't do anything to notify the function project when it's in a state where it's referenced versions of these that cannot be loaded by the host.

    Here's a repro project for the broken in-process azure function:
    FunctionApp1.zip

    Azure functions did create a solution for this problem, and that's the "Isolated" function model. When you create your function, make sure to select "Isolated" as shown below.
    image

    Here's a repro project for the working isolated process azure function:
    FunctionApp2.zip

    Here's more detail on the different types of Azure functions: https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide

    Fabio Cavalcante (@fabiocav) it would be nice if Azure Functions SDK would notify users when they were in this state - either with a better runtime exception - or even better - a build time error letting them know the application was referencing an assembly version that wouldn't be loadable in the shared host.

  4. wrharper-AASP commented on Jun 30, 2023

    @wrharper-AASP
    Author

    I guess the only choice is to wait for in-process to get fixed. Isolated won't work for what I am doing.

  5. wrharper-AASP commented on Jun 30, 2023

    @wrharper-AASP
    Author

    the custom build I have created is working. so I will just use it until in-process is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions