Welcome to Microsoft Q&A! Thanks for posting the question.
I am sorry for the inconvenience faced by you because of this issue. It is under active investigation, and you can refer to the following thread for details on GitHub.
https://github.com/Azure/azure-functions-host/issues/8119
This is because the V4 functions host requires eventhub extension 4.3.0 or later (this check was added here, because of Azure/Azure-Functions#2072). However, it appears that neither the 2.x bundle nor the 3.x bundle contain this version of the extension. (Extracted from the GitHub issue above)
The workaround is to use the following entry in host.json
file. For functions created from Azure Portal, you can find this file under "Azure Functions" page --> "App files".
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[2.8.4, 3.0.0)"
}
}
---
Regarding the PowerShell snippet in the question above, please note that the cloud shell (here powershell) opened from Azure Portal's "Cloud shell" button () is only for managing Azure resources. The command Install-Package
run here will install the modules for this shell only and not for any of the resources deployed in your Azure Subscription. For example, if you have an Azure VM or Azure Web Apps service created in your subscription, this command will not install the package on them.
In the current scenario, another approach would be to use Visual Studio or Visual Studio Code to create and test the function locally. Through this method, you would have the control to project files (.csproj
) in case you would want to add reference to specific version of package.
Please let me know if you have any questions.
---
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.