Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions V4 - Require a minimum version for supported extensions #1987

Closed
paulbatum opened this issue Jul 22, 2021 · 40 comments
Closed

Functions V4 - Require a minimum version for supported extensions #1987

paulbatum opened this issue Jul 22, 2021 · 40 comments

Comments

@paulbatum
Copy link
Member

paulbatum commented Jul 22, 2021

This issue proposes that functions V4 should require a minimum version for each of the supported functions extensions (storage, eventhubs, servicebus, etc).

Discussion for this proposal: #1988

Sent here by an error message?

Read this comment below for instructions on how to resolve.

Motivation

We often fix bugs in our extensions, or update our extensions to use newer Azure SDKs that have relevant bug fixes. Unfortunately, we are not able to guarantee that our customer receive those fixes. As a result, often the first step when engaged in a support case is to have a customer update their extensions to the latest version. Sometimes we ask the customer to do this simply because the newer extension has better logging, and that can make a big difference for tracking the problem down.

For functions V4, we could reduce the size of this problem by adding logic that rejects extensions that are no longer supported. For example, we are still releasing fixes for Microsoft.Azure.WebJobs.Extensions.Storage 4.x, but the same is not true for 3.x - so why even let a v4 function app load a 3.x storage extension?

Spec

The functions host will enforce the proposed minimum versions in the table below. If an older version of one of the following extensions is present, the host will throw an error specifying the minimum required version and fail to start.

Extension Minimum Version
Microsoft.Azure.WebJobs.Extensions.Storage 4.0.4
Microsoft.Azure.WebJobs.Extensions.ServiceBus 4.2.1
Microsoft.Azure.WebJobs.Extensions.EventHubs 4.3.0
Microsoft.Azure.WebJobs.Extensions.DurableTask 2.4.1
Microsoft.Azure.WebJobs.Extensions.CosmosDB 3.0.9
Microsoft.Azure.WebJobs.Extensions.EventGrid 2.1.0
Microsoft.Azure.WebJobs.Extensions.RabbitMQ 1.0.0
Microsoft.Azure.WebJobs.Extensions.Kafka 3.2.1

We can modify these to be less restrictive in terms of required patch version if we want to reduce how many customers will have to do an update as part of their upgrade to V4.

Note that none of the above versions reference any of the modern Azure SDKs that were released recently. Many of those SDKs have breaking changes and this proposal does not attempt to enforce that customers use those. Such a change would require customers to do significant code rewrites to be able to move to functions V4, which is not desirable.

A side effect of this will be to reject loading an application that is using the 1.0 extension bundle. We would probably implement a check for that so that we can provide a friendly error message (please upgrade to the 2.0 bundle).

Impact

Every non .NET user on the 1.0 bundle would be impacted when they try to upgrade to V4. Updating their host.json to reference the 2.0 bundle should be relatively straightforward as we have not seen much evidence of breaking changes between the major versions of the libraries in bundles 1.0 and 2.0.

For a .NET user, they would have to do a set of NuGet updates to get the supported extensions installed. Because Azure SDK API surface area is more directly accessable in .NET function apps, some of these customers would need to make small code changes to get their code compiling, but there are no known breaks that force a significant code rewrite.

We suspect around 60% of apps upgraded to V4 will require this change.

Compat-mode support

It would be straightforward to put this behind a flag, but doing so defeats the purpose. I suggest only adding a compat flag if we discover really significant upgrade blockers that are impacting customers from upgrading to V4 (especially once .NET 3.1 end-of-life gets close).

Alternatives

We could try to use more aggressive detection of older extensions as part of the support case submission flow. However this means that customers will spend more time struggling with bugs during development time that have been fixed long ago. It also will not deflect github issues being filed about previously fixed issues.

Detection

Yes this is trivial - we already have detectors that check the extension versions, and we can also write a detector that catches the "extension is too old and not supported" error and directs the user with specific instructions.

Support

In the long term, this change should have a positive support impact. Cases are often resolved by just having a customer upgrade their extensions. In the short term, we might see some support case volume due to customers hitting this error when upgrading to V4. We should be able to deflect a significant portion of that by implementing a detector as mentioned above. The remaining support volume would be due to customers that do not want to upgrade their extensions for unanticipated reasons. I expect this would be low volume.

Support would need to be notified of the change, but ideally deflection would be in place by the time the change is enforced.

Documentation

We'd need to update the documentation for each binding to spell out this minimum version that applies to V4.

Components impacted

I believe this change would only impact the host. We can consider an analyzer (helps catching the problem as part of CI).

Performance

No expected perf impact.

@paulbatum
Copy link
Member Author

paulbatum commented Oct 26, 2021

A quick note for anyone landing on this issue after encountering the error:
Referenced bundle Microsoft.Azure.Functions.ExtensionBundle of version 1.8.1 does not meet the required minimum version of 2.6.1. Update your extension bundle reference in host.json to reference 2.6.1 or later.

This documentation page has a table that shows how to reference the 2.x bundle and satisfy the requirement:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-register#extension-bundles

Pasting here also for convenience - you need the following entry in your host.json file:

    "extensionBundle": {
        "id": "Microsoft.Azure.Functions.ExtensionBundle",
        "version": "[2.*, 3.0.0)"
    }

If you're a .NET user encountering an error like this:
ExtensionStartupType AzureStorageWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.10.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.0.4.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.Storage to 4.0.4 or later.

Then a NuGet update to version 4.0.4 (or later) of the Microsoft.Azure.WebJobs.Extensions.Storage package will be sufficient to resolve the issue. Similar applies for similar errors for the other extensions.

@tommck
Copy link

tommck commented Dec 2, 2021

@paulbatum now, running an older functions project (.net 3.1, etc), we still get these errors if we run func host start after installing the v4 SDK

@paulbatum
Copy link
Member Author

@tommck That would be because your running that .NET 3.1 project on functions V4 using the V4 core tools. You should continue to use the V3 tools when working with V3 projects (until you want to upgrade them).

I know VS makes this straightforward by running the right tools version based on the project, but if you're running off the command line you'll need to pick the version explicitly. You can download a V3 core tools release manually from here.

Alternatively you could try this unofficial version manager, funcvm.

@tommck
Copy link

tommck commented Dec 2, 2021

@paulbatum I do work with both frameworks. how do I tell func I want to run the older stuff? I had the v3 tools installed, then installed the v4 tools to do some other work. Now, func in my path is the v4 version. It doesn't seem like the v3 version still exists. dotnet allows you to have a global.json (which I do have) and that respects the version I specified. How can I use both versions of the tools on one machine?

Just use the funcvm? :(

@paulbatum
Copy link
Member Author

func.exe is not multiversion, its single version, so you don't pass a param to func.exe, you choose which func.exe you want to run. Thats what VS does under the covers, and similarly thats what funcvm does. So without using any other libraries/tools, you would download and unzip one of the V3 releases and then run func.exe from that directory e.g. d:\tools\functions-tools-v3\func.exe host start

@heavenwing
Copy link

When I use https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage/5.0.0, I still got an error like this:
ExtensionStartupType AzureStorageWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.10.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.0.4.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.Storage to 4.0.4 or later.

@paulbatum
Copy link
Member Author

@heavenwing please file a new issue in https://github.com/azure/azure-functions-host - tag me on the issue, include your csproj, and share more details about whether you are hitting this error locally, or only when deploying.

@hannesne
Copy link

Hi there, I receive this error when trying to start the logic apps designer. I figure it's cause the logic apps designer brings in a different extension bundle that's old. I can't figure out how to fix it, but I assume I need to change the version of the Microsoft.Azure.Functions.ExtensionBundle.Workflows - which is currently set to [1.*, 2.0.0). I get the following error:

9:21:10 am: Running command: "func host start --port 8000"...

Azure Functions Core Tools
Core Tools Version:       4.0.3971 Commit hash: d0775d487c93ebd49e9c1166d5c3c01f3c76eaaf  (64-bit)
Function Runtime Version: 4.0.1.16815

[2021-12-16T20:21:11.693Z] ExtensionStartupType EventHubsWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.EventHubs, Version=4.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.2.0.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.EventHubs to 4.2.0 or later.
[2021-12-16T20:21:11.699Z] A host error has occurred during startup operation 'fc077d2f-0d52-4d8d-b1aa-95b222ff8ec0'.
[2021-12-16T20:21:11.699Z] Microsoft.Azure.WebJobs.Script: One or more loaded extensions do not meet the minimum requirements. For more information see https://aka.ms/func-min-extension-versions.
[2021-12-16T20:21:11.699Z] ExtensionStartupType EventHubsWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.EventHubs, Version=4.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.2.0.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.EventHubs to 4.2.0 or later.
[2021-12-16T20:21:11.700Z] .
Value cannot be null. (Parameter 'provider')
[2021-12-16T20:21:11.749Z] A host error has occurred during startup operation '449abe3b-b1d5-48de-876e-5c4990bd7c3a'.
[2021-12-16T20:21:11.749Z] Microsoft.Extensions.DependencyInjection: Cannot access a disposed object.
[2021-12-16T20:21:11.749Z] Object name: 'IServiceProvider'.

@rohithah
Copy link

@hannesne - Logic Apps VS Code extension doesn't support Functions Core tools V4. Can you try making "path" environment variable point to V3 Functions Core tools folder before starting the designer?

@pchevallier
Copy link

Our Azure function (javascript node 14) was running fine until few minutes ago. I don't know if this has to do with this push, but it stopped running complaining about this Microsoft.Azure.Webjobs.Evenhub package version (4.2) that should be brought up to 4.3.

It's all good, but now how do I update this particular package directly from the Azure portal ? (via the Azure console maybe?)
or is that not even an option, and I do need to redeploy the code on a brand new Azure function ?
Screenshot 2022-02-04 155924

@paulbatum
Copy link
Member Author

@pchevallier since this is a JavaScript app you are most likely using an extension bundle. You can update the bundle by modifying your host.json - the changes are discussed in this comment.

Whether you can do it directly via the portal depends on how you have setup your function app in terms of deployment method. You might be able to edit the file directly, using the App Files section in the left hand side, like so:
image

Alternatively, this might show you a warning about the file being read only, because you have deployed from a package. If that is the case, you'll need to deploy a new package containing the changes to the host.json file. In that case I'd recommend you just make the change and deploy in the same way that you would for any type of change to your function code.

@sebsmgzz
Copy link

sebsmgzz commented Mar 3, 2022

@pchevallier Thanks, this was enough for me to find the problem - I filed Azure/azure-functions-host#8119 and am pinging the appropriate teams to get a fix. In the meantime.. can you try the workaround I suggested in that issue? Basically try this for host.json:

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.8.4, 3.0.0)"
  }
}

I was having the same issue and this workaround did the trick for me with a JS function app.

ievsantillan added a commit to ievsantillan/Purview-Custom-Types-Tool-Solution-Accelerator that referenced this issue Mar 15, 2022
to fix issue #10 "Referenced bundle Microsoft.Azure.Functions.ExtensionBundle of version 1.8.1 does not meet the required minimum version of 2.6.1. Update your extension bundle reference in host.json to reference 2.6.1 or later"
microsoft#10
Azure/Azure-Functions#1987
error505 added a commit to error505/azure-cognitive-search-react-template that referenced this issue Apr 5, 2022
Added support for the new Azure function version V4
Azure/Azure-Functions#1987
oleksis added a commit to oleksis/azure-python-labs that referenced this issue May 7, 2022
[Functions V4 - Require a minimum version for supported extensions](Azure/Azure-Functions#1987 (comment))
@ggailey777
Copy link
Contributor

@paulbatum: FYI, I've retargeted your aka.ms link to this new section in the versioning article.

asw101 pushed a commit to Azure-Samples/azure-python-labs that referenced this issue May 27, 2022
[Functions V4 - Require a minimum version for supported extensions](Azure/Azure-Functions#1987 (comment))
@abhinav-jain09
Copy link

[2.8.4, 3.0.0)

This solution does not work for me . I am using java

@SeaDude
Copy link

SeaDude commented Oct 7, 2022

I'm getting this error for some reason too...

Why does func tools all of a sudden think I'm working with extensionBundle 1.8.1? I'm clearly not.

(.venv) PS E:\dataDocuments\python\async_dev> func start
Found Python version 3.9.5 (python).

Azure Functions Core Tools
Core Tools Version:       4.0.4785 Commit hash: N/A  (64-bit)
Function Runtime Version: 4.10.4.19213

[2022-10-07T04:44:16.391Z] Referenced bundle Microsoft.Azure.Functions.ExtensionBundle of version 1.8.1 does not meet the required minimum version of 2.6.1. Update your extension bundle reference in host.json to reference 2.6.1 or later.
[2022-10-07T04:44:16.399Z] A host error has occurred during startup operation 'e7cd7951-4085-4365-ac16-43b8c531e64c'.
[2022-10-07T04:44:16.400Z] Microsoft.Azure.WebJobs.Script: Referenced bundle Microsoft.Azure.Functions.ExtensionBundle of version 1.8.1 does not meet the required minimum version of 2.6.1. Update your extension bundle reference in host.json to reference 2.6.1 or later. For 
more information see https://aka.ms/func-min-bundle-versions.
Value cannot be null. (Parameter 'provider')

Opened a ticket here too

  • Besides adding [2.8.4, 3.0.0) to host.json extensionBundle and updating Azure Function Core Tools, how do I troubleshoot this?

image

@jacksorjacksor
Copy link

jacksorjacksor commented Dec 8, 2022

On building the Function app after adding the extensionBundle snippet to host.json I've received the following error message:

Extension bundle configuration should not be present for the function app with pre-compiled functions. Please remove 
extension bundle configuration from host.json

Any advice on how to resolve? TIA!

@jenp-jb
Copy link

jenp-jb commented May 9, 2023

Deploying to Azure (yesterday and today) we are getting an error about the ServiceBus extension being out of date but we are using 5.9.0. Any ideas what our actual issue could be?

Microsoft.Azure.WebJobs.Script.ExternalStartupException : Error building configuration in an external startup class. ---> Microsoft.Azure.WebJobs.Script.HostInitializationException : One or more loaded extensions do not meet the minimum requirements. For more information see https://aka.ms/func-min-extension-versions. ExtensionStartupType ServiceBusWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.ServiceBus, Version=4.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.2.1.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.ServiceBus to 4.2.1 or later. at Microsoft.Azure.WebJobs.Script.DependencyInjection.ScriptStartupTypeLocator.ValidateExtensionRequirements(List1 startupTypes) at /_/src/WebJobs.Script/DependencyInjection/ScriptStartupTypeLocator.cs : 353 at async Microsoft.Azure.WebJobs.Script.DependencyInjection.ScriptStartupTypeLocator.GetExtensionsStartupTypesAsync() at /_/src/WebJobs.Script/DependencyInjection/ScriptStartupTypeLocator.cs : 239 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Azure.WebJobs.Script.DependencyInjection.ScriptStartupTypeLocator.<.ctor>b__10_0() at /_/src/WebJobs.Script/DependencyInjection/ScriptStartupTypeLocator.cs : 53 at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication,Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at System.Lazy`1.get_Value() at Microsoft.Azure.WebJobs.Script.DependencyInjection.ScriptStartupTypeLocator.GetStartupTypes() at //src/WebJobs.Script/DependencyInjection/ScriptStartupTypeLocator.cs : 68 at Microsoft.Azure.WebJobs.WebJobsBuilderExtensions.UseExternalConfigurationStartup(IWebJobsConfigurationBuilder builder,IWebJobsStartupTypeLocator startupTypeLocator,WebJobsBuilderContext context,ILoggerFactory loggerFactory) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Hosting\WebJobsBuilderExtensions.cs : 362 at Microsoft.Azure.WebJobs.Script.ScriptHostBuilderExtensions.<>c__DisplayClass7_3.b__8(IWebJobsStartupTypeLocator locator) at //src/WebJobs.Script/ScriptHostBuilderExtensions.cs : 246 End of inner exception

CsProj file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <InformationalVersion>local</InformationalVersion>
    <FileVersion>local</FileVersion>
    <NoWarn>7035</NoWarn>
    <UserSecretsId>df2c7f8a-6d64-40b3-a119-1a2a892637f2</UserSecretsId>
    <RootNamespace>MyApp</RootNamespace>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="FluentValidation" Version="11.5.2" />
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.9.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
    <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
    <PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

@paulbatum
Copy link
Member Author

@jenp-jb the csproj you shared looks fine, I can't see any problems there. I think there must be something wrong with your build output, maybe an old version of the extension is still lying around? The clue here is that Microsoft.Azure.WebJobs.ServiceBus, Version=4.1.1.0 is being loaded. One thing to note about this is that the assembly name changed. The NuGet you are referencing should create Microsoft.Azure.WebJobs.Extensions.ServiceBus.dll in your build output which will be version 5.9.0. So its possible you have an old version and new version side by side if your build output hasnt been cleaned up.

@jenp-jb
Copy link

jenp-jb commented May 9, 2023

@paulbatum I've had a look at the Azure files using Kodo - but I just don't see any old Dll lingering around unless I'm being blind.
image
We run the function as packaged.

@paulbatum
Copy link
Member Author

Can you share the contents of your extensions.json file? I think it should look like this:

{
  "extensions":[
    { "name": "ServiceBus", "typeName":"Microsoft.Azure.WebJobs.ServiceBus.ServiceBusWebJobsStartup, Microsoft.Azure.WebJobs.Extensions.ServiceBus, Version=5.9.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8"}
  ]
}

@jenp-jb
Copy link

jenp-jb commented May 10, 2023

@paulbatum

{
  "extensions":[
    { "name": "ServiceBus", "typeName":"Microsoft.Azure.WebJobs.ServiceBus.ServiceBusWebJobsStartup, Microsoft.Azure.WebJobs.Extensions.ServiceBus, Version=5.9.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8"},
    { "name": "Startup", "typeName":"Refund.Processor.Startup, Refund.Processor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"}
  ]
}

Looking at the Process Explorer - no sign of an old one.
image

@paulbatum
Copy link
Member Author

@jenp-jb everything you shared looks correct. I am really struggling to come up with an explanation for how that error would occur given the details you've shared, but I guess there must be some detail I'm missing. If you haven't already, I encourage you to file a ticket through azure support.

@jenp-jb
Copy link

jenp-jb commented May 15, 2023

@paulbatum just an FYI turns out we had missed the setting for run as package for this repo - it's weird that it was displaying this error when the running processes didn't include the old dll, but we eventually tracked down this setting not being set as expected and the message seems to have gone away. Thanks for your assistance!

@goanwied
Copy link

goanwied commented Aug 16, 2023

Hello @paulbatum

I experience a similar issue as @heavenwing has. I upgraded an azure function to v4 and currently receive the following error in Azure Portal.

image

Microsoft.Azure.WebJobs.Script.ExternalStartupException : Error building configuration in an external startup class. ---> Microsoft.Azure.WebJobs.Script.HostInitializationException : One or more loaded extensions do not meet the minimum requirements. For more information see https://aka.ms/func-min-extension-versions. ExtensionStartupType AzureStorageWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.11.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.0.4.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.Storage to 4.0.4 or later

I have applied some changes, such as applying the WEBSITE_RUN_FROM_PACKAGE = 1 in the config of the Azure function and updating to CICD pipeline to deploy as runFromPackage.

Also I added the package Microsoft.Azure.WebJobs.Extensions.Storage to the project, however still receiving the above error.

image

Interestingly I can see the my queue or time triggered function have been executed.

@GoEddie
Copy link

GoEddie commented Aug 25, 2023

Can someone confirm that this is the correct behaviour:

  • We have a fully functioning deployed azure function app running perfectly well
  • Someone at Microsoft arbitrarily decides a minimum sdk version to make it easier to support
  • Our fully functioning deployed azure function fails to start next time it is restarted
  • We get no warnings, no notifications, the functions just fail to start

This can happen at any time? Even in critical business processing periods and there is no other way to fix it other than upgrading the SDK's and making any necessary code changes.

Are there any warnings/alerts informing customers of changes before they occur?

@paulbatum
Copy link
Member Author

@GoEddie That summary doesn't seem correct. This minimum version enforcement only applies in functions host version 4.x, and upgrading from 3.x to 4.x is a customer initiated action.

Here's the documentation page about host versions:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions

When you start the 3.x->4.x upgrade process in your local dev environment (VS, VSCode, CLI, etc) you would see the same error immediately, so you know its coming before you've even deployed.

If you have a deployed function app that seems to be suddenly giving this error when it was running previously, I can only think of two possibilities:

  • it was already on 4.x and a deployment was performed that moved its dependencies backward to older versions
  • it was on 3.x and a config update action has moved it to 4.x

It is true that 3.x is out of support, so to be on a supported version of functions you need to go through this upgrade. Communications for 3.x going out of support were sent well in advance. This particular change is listed in the breaking changes:
https://learn.microsoft.com/en-us/azure/azure-functions/migrate-version-3-version-4?source=recommendations&tabs=net6-isolated%2Cazure-cli%2Cwindows&pivots=programming-language-csharp#breaking-changes-between-3x-and-4x

@GoEddie
Copy link

GoEddie commented Oct 5, 2023

@paulbatum thank you, we must have updated to v4 at some point I guess.

@alurbina
Copy link

Hello @paulbatum

I experience a similar issue as @heavenwing has. I upgraded an azure function to v4 and currently receive the following error in Azure Portal.

image

Microsoft.Azure.WebJobs.Script.ExternalStartupException : Error building configuration in an external startup class. ---> Microsoft.Azure.WebJobs.Script.HostInitializationException : One or more loaded extensions do not meet the minimum requirements. For more information see https://aka.ms/func-min-extension-versions. ExtensionStartupType AzureStorageWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.11.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.0.4.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.Storage to 4.0.4 or later

I have applied some changes, such as applying the WEBSITE_RUN_FROM_PACKAGE = 1 in the config of the Azure function and updating to CICD pipeline to deploy as runFromPackage.

Also I added the package Microsoft.Azure.WebJobs.Extensions.Storage to the project, however still receiving the above error.

image

Interestingly I can see the my queue or time triggered function have been executed.

Also experiencing similar behavior on this, were you able to get a resolution?

@avinashvarma1
Copy link

avinashvarma1 commented Nov 7, 2023

Hello @paulbatum , am experiencing similar issue as @heavenwing @goanwied

I have the same issue with below error after Fuction app is upgraded to 4x.

AZFD0005 Error building configuration in an external startup class.

Microsoft.Azure.WebJobs.Script.ExternalStartupException : Error building configuration in an external startup class. ---> Microsoft.Azure.WebJobs.Script.HostInitializationException : One or more loaded extensions do not meet the minimum requirements.

It's a .Net app(v6). Upgraded from 3x to 4x
We tried enabling below extensionBundle 4.0.4 with a new package deployment with no luck.

{"version": "2.0","logging": {"applicationInsights": {"samplingSettings": {"isEnabled": true,"excludedTypes": "Request"}}},"extensionBundle": {"id": "Microsoft.Azure.Functions.ExtensionBundle","version": "[3.*, 4.0.4)"}}

Please suggest resolutions. It's a showstopper in the test environment.

@laura-vuilleumier
Copy link

I had the same issue as @heavenwing, @goanwied and @avinashvarma1. I had the following error, even though my Nuget package version was set to 5.13.5, checked everything in this thread and it all looked correct.

ServiceBusWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.ServiceBus, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.2.1.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.ServiceBus to 4.2.1 or later.

It turns out the error was cached in storage, and clearing it removed the error. Found this solution in Stack Overflow:

So apparently MSFT has said the error sticks with your function app even when you resolve the error.

In my case, the error was fixed but the portal still showed the error. You can clear the error by heading over to the storage account associated with your function app and clearing the table :

"AzureFunctionsDiagnosticEventsDATEHERE"

If you clear the table and the error persists, then you did not fix the underlying problem. You can confirm this by checking the table you just cleared to ensure no new entries have been made, if an entry has been made after you cleared the table, you still have issues.

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

No branches or pull requests