Azure function not running after upgrade to dotnet net6 framework even though I have the latest package

Swatantra Yadav 10 Reputation points Microsoft Employee
2023-03-21T23:04:37.51+00:00

After upgrading my azure functions from dotnet core 3.1 to net6 the function is not starting. The package I reference is more recent than minimum requirement. The error I see in the Azure Portal is that it requires a minimum version of this package 4.2.1.0 even though I am using 5.8.1:

<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.8.1" />

Is there a "maximum version" that is has to be used? I am setting FUNCTIONS_EXTENSION_VERSION= ~4

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Swatantra Yadav 10 Reputation points Microsoft Employee
    2023-06-03T23:33:27.63+00:00

    Posting this for the benefit of several others who had this issue.

    To fix this follow these steps:

    1. Login to azure portal and go to the azure function
    2. go to Advanced tools in the left panel
    3. open “debug tools” on top
    4. Check the version of bad file and if it is older than the minimum version required for net6 then delete it and redeploy
    5. if that does not fix then go to configuration
    6. check the value of variables called “Framework version” make sure it is ~4 https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#functions_extension_version
    1 person found this answer helpful.
    0 comments No comments

  2. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2023-03-31T19:49:14.5766667+00:00

    Swatantra Yadav Thanks for sharing the additional info. Based on the exception above, it looks like there is a reference to deprecated library Microsoft.Azure.WebJobs.ServiceBus (https://www.nuget.org/packages/Microsoft.Azure.WebJobs.ServiceBus) in your project file which didn't meet the minimum version enforced. Please remove it and use Microsoft.Azure.WebJobs.Extensions.ServiceBus with version 5.8.1 like you mentioned above and redeploy the app.

    I hope this helps with your question and let me know if you have any other questions.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.