How to Change Azure Function Runtime Version in Visual Studio

How To Find Azure Functions Run Time Version in Azure Portal

This Azure tutorial will discuss how to check the Azure function runtime version in Visual Studio, Azure Portal, and PowerShell.

How to Change Azure Function Runtime Version in Visual Studio

Follow the below steps

1. Open your Azure Function Project in the Visual Studio 2019.

2. Right-click on the Azure Function Project name and then click on the Edit Project file option as highlighted below

functions_extension_version

3. Now you can see the .csproj file that looks like the one below

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <AzureFunctionsVersion>v2</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.36" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

You can see the Azure Function version as highlighted below

check azure function version

You can also change the Azure Function Versions and the TargetFramework and click the Save button to save the changes.

If you want to change the Azure function to version V1, you can change the target framework to net461, as shown below.

<TargetFramework>net461</TargetFramework>
<AzureFunctionsVersion>v1</AzureFunctionsVersion>

Similarly, If you want to change the Azure function version to version V2, You can change the TargetFramework to netcoreapp2.1 like below.

<TargetFramework>netcoreapp2.1</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>

If you want to update the Azure function to version V3, you can change the TargetFramework to netcoreapp3.1, as shown below.

<TargetFramework>netcoreapp3.1</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>

You can also check out Functions_Extension_Version.

Change Azure Function Version – Video Tutorial

You may also like following the below Articles

Wrapping Up

This article discussed how to change the Azure Function runtime version in Visual Studio, Azure Portal, and PowerShell. I hope you have enjoyed this article !!!