skip to Main Content

I have upgraded a .net6 Azure function (using an App Service plan, not Consumption) to an isolated .net8 function. All my assemblies have <TargetFramework>net8.0</TargetFramework>

The function project has also

<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>

and also

  <ItemGroup>
        <Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
  </ItemGroup>

( I have no idea what it’s doing but it was given in a Microsoft upgrade article).

When deploying, the pipeline sets the following values:

"FUNCTIONS_EXTENSION_VERSION": "~4",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED": 1,
"WEBSITE_RUN_FROM_PACKAGE": 1,

My functions seem fine, scheduled functions are triggered, and service bus messages go through.

Still, Azure shows the warning:

The 'FUNCTIONS_WORKER_RUNTIME' is set to 'dotnet-isolated', which does not match the worker runtime metadata found in the deployed function app artifacts. The deployed artifacts are for 'dotnet'. See https://aka.ms/functions-invalid-worker-runtime for more information. The application will continue to run but may throw an exception in the future.

I redeployed and restarted the function multiple times during the last two days, but the message did not go away.

I started hunting for the mysterious "worker runtime metadata" but could not find any useful information. Then I looked inside the artifact zip that is built by the pipeline and searched for "dotnet" text inside. The only text files mentioning it are worker.config.json with:

{
  "description": {
    "language": "dotnet-isolated",
    "extensions": [ ".dll" ],
    "defaultExecutablePath": "dotnet",
    "defaultWorkerPath": "MyNamespace.Function.dll",
    "workerIndexing": "true",
    "canUsePlaceholder": true
  }
}

and functions.metadata, which has "language": "dotnet-isolated" for all of the functions. So, no mention of "dotnet" without "isolated".

Function settings in Azure look good after deployment: Runtime version ~4, .NET Version is .NET 8 Isolated.

When I look at the individual functions themselves in Azure and try to edit them, I get this warning:

Editing .NET isolated Function Apps is not supported in the Azure portal. Use your local development environment to edit this Function App.

This indicates that the functions are correct with the language "dotnet-isolated".

What am I missing here? Where is this mysterious "worker runtime metadata" that Azure warns about?

2

Answers


  1. I don’t think you are missing anything at all. The warning indicates, that the deployed version is a in-process function which is different than the version you are deploying. Which is expected after migrating an existing function.

    You can check in the Portal which language is used. And update it to dotnet-isolated. As far as I know, this should resolve the warning.

    Azure Portal Screenshot showing the language selection

    If you are using ARM Templates, ensure you set properties.siteConfig.netFrameworkVersion to "v8.0"

    If you go to https://resources.azure.com/, you should be able to see the metadata of the App Service, or if you look into the audit logs after applying the settings over the portal (from above). But those are set indirectly by deploying the first time or by updating the language

    Login or Signup to reply.
  2. Did you ever resolve this? I have the same issue when migrating from .net 6 in-process to .net 8 isolated. Initially when I deployed using a DevOps pipeline the functions weren’t even appearing. So I deployed from Visual Studio and that worked. I realised that I had to manually set the FUNCTIONS_WORKER_RUNTIME to dotnet-isolated, restart the app and then change to .Net 8 Isolated from the dropdown. I did this in another environment, deployed using DevOps and the new, upgraded functions appear, but I’m getting the warning

    The ‘FUNCTIONS_WORKER_RUNTIME’ is set to ‘dotnet-isolated’, which does
    not match the worker runtime metadata found in the deployed function
    app artifacts

    I’m not getting this in the environment where I published using Visual Studio. There’s obviously something different, but I can’t see what. All variables and config look the same between the 2.

    The warning is still showing even if I change FUNCTIONS_WORKER_RUNTIME back to dotnet, which makes no sense. It must be a bug or caching issue

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search