How do you solve AZFD0005 Azure Function App Error
Asked Answered
C

2

12

enter image description here

Currently having issues with a Node Azure Function App throwing Error AZFD0005. The node application runs fine locally. The specific error from Azure is :

Microsoft.Azure.WebJobs.Script.ExternalStartupException : Error building configuration in an external startup class. ---> Microsoft.Azure.WebJobs.Script.HostInitializationException : 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.

enter image description here

We have a total of 3 Function apps in a resource group that seem to have this error which started Friday 4/07/23. Before this time, the functions were running fine with no errors. We can focus on 1.

I have tried several different ways to solve this error, first one being the obvious. Lets call the problem app stackoverflow-test-app.

  1. I deleted the function app : stackoverflow-test-app using the portal and re-deployed using the infrastructure pipeline with upgraded host.json to [3.3.0, 4.0.0). - This did not remove the error

  2. I deployed a function app : stackoverflow-test-app-two with a new name using the infrastructure pipeline and using the same configuration as stackoverflow-test-app (this was done to try and replicate the error on a new function app) - This somehow works and doesn't show the AZFD0005 error

  3. I decided to not use our infrastructure pipeline and not deploy code (so have the function app bare bones) and try deploying using CLI. I used the "az functionapp create" command (this was done to ensure nothing unexpected was going on in our infrastructure) - This did not remove the error

  • The command i used was:

az functionapp create -g "groupHere" -p "planHere" -n "nameHere" -s "storageHere" --assign-identity '[system]' --runtime node --runtime-version 16 --functions-version 4

  1. I thought maybe something was broken with node runtime 16 so decided to use the command above and use node 14 function version 3. This did not remove the error

  2. I deleted the function app : stackoverflow-test-app and created the same function using the portal - This did not remove the error

This is what baffles me, the only thing that removed the error was creating a whole new function appstackoverflow-test-app-two with a separate name and using the same configuration. I can delete the problem function app : stackoverflow-test-app fine, but the moment i re-create it with the same function name whether that's with the portal or CLI commands, the AZFD0005 error pops up again.

I can confirm all is okay with the resource group, app service plan or storage account since any new function app created will work fine.

Here is my host.json:

{
      "version": "2.0",
      "logging": {
        "applicationInsights": {
          "samplingSettings": {
            "isEnabled": true,
            "excludedTypes": "Request"
          }
        }
      },
      "extensionBundle": {
        "id": "Microsoft.Azure.Functions.ExtensionBundle",
        "version": "[3.3.0, 4.0.0)"
    }
    }
Calfee answered 12/4, 2023 at 2:18 Comment(0)
C
22

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.

Calfee answered 12/5, 2023 at 1:40 Comment(3)
Bro you don't even know how much time you saved me, I cant understand why we cache errors and we need to clear them!!Brieta
We found the issue, but it never made sense for the error we were getting. This will save me so much time in the future and exposed the error which was happening, which would have saved so much time. Thank you so much @CalfeePollard
What a beautiful design choice! sarcasmScalenus
L
0

I have referred this Github
link
by paulbatum and this Document and upgraded the Function extension to resolve this error:-

I tried to deploy a Node.js Azure Function with host.json settings set to:-

Code:-

"extensionBundle": {

"id": "Microsoft.Azure.Functions.ExtensionBundle",

"version": "[1.*, 1.8.1)"

Deployment:-

Command:-

func azure functionapp publish functionapp

enter image description here

Error:-

enter image description here

I tried to change the name of my function trigger in my VS code locally like below:-

enter image description here

Renamed:-

enter image description here

I deployed the function again with the same host.json setting and received the same error:-

enter image description here

Error:-

enter image description here

But when I created a new Javascript function it automatically took the latest Azure function extension and the error was resolved, Refer below:-

New function app in new folder:-

enter image description here

host.json above:-

{

"version": "2.0",

"logging": {

"applicationInsights": {

"samplingSettings": {

"isEnabled": true,

"excludedTypes": "Request"

}

}

},

"extensionBundle": {

"id": "Microsoft.Azure.Functions.ExtensionBundle",

"version": "[3.*, 4.0.0)"

}

}


Deployed the new function to the function app and the error got resolved, Refer below:-

enter image description here

enter image description here

But the previous error was still visible in the Portal Overview page of Azure Function app, This is a transient issue on the Portal’s end and it did not affect the new function trigger that was deployed above.

As, The Diagnose and Solve problem section did not show any such error when I deployed the new function with above settings :-

enter image description here

As a workaround, I deployed the Function trigger in a new function app and the issue was resolved, Refer below:-

enter image description here

enter image description here

According to github link by paulbatum and this Document the Make sure your Azure Function’s Host.json is set to

"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.*, 4.0.0)"

Also, It might be the case that while creating a new function your host.json is getting created newly with the upgraded extension.

Losing answered 17/4, 2023 at 6:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.