How to Change Azure Function Runtime Version in Visual Studio

 

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

How to Change Azure Function Runtime Version in Visual Studio

To change Azure Function Runtime Version in Visual Studio, follow the steps below

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.

Video Tutorial

Wrapping Up

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

You may also like the following Articles

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!