Migrate Azure Function app from .NET Core v2 to v3

For migrating an Azure Function app from .NET Core v2 to v3 follow the following steps
  1. Unload the Azure function project by right clicking the project and selecting unload.
  2. Change
      <propertygroup>
       <targetframework>netcoreapp2.2</targetframework>
       <azurefunctionsversion>v2</azurefunctionsversion>
      </propertygroup>
             

to
  <propertygroup>
    <targetframework>netcoreapp3.1</targetframework>
    <azurefunctionsversion>v3</azurefunctionsversion>
  </propertygroup>

  1. Reload the Azure function project by right clicking the unloaded project
  2. Update the Microsoft.NET.Sdk.Functions nuget package to version 3.0.2 or higher
  3. Update the Microsoft.Azure.WebJobs.Extensions (when installed) to version 4.0.0 or higher
  4. In the local.settings.json change the FUNCTIONS_EXTENSION_VERSION setting to "~3"
  5. When I for the first time tried to start the converted Azure function project I got the message "no Functions runtime available that matches the version specified in the project.". I fixed this by following these steps
    1. Close existing Visual studio projects / solutions
    2. Updating Visual Studio to the latest update
    3. Create a new Azure Function project
    4. By the template setting check if the .NET Core 3 framework option is there, if not check if you have a spinner below in the screen, wait a while. The spinner did not stop spinning, I cancelled the screen and retried and after that I could create a .NET Core 3 framework project. 
    5. Just create a default timer project.
    6. Close Visual studio and restart your converted Azure function project
Some errors that I found:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Solution: Change in the project file azurefunctionsversion from v2 to v3

Comments

Popular posts from this blog

System.Net.Http dll version problems

SharePoint Survey Back Button

Azure table storage error: One of the request inputs is not valid