简体   繁体   中英

Message - Update Functions Version on Azure

I have upgraded some of my Azure Functions to .netstandard 2.0, that is still in beta. Whenever I publish my Functions directly from Visual Studio, I get the following message:

在此处输入图片说明

The csproj file containing my Functions is already is targeting .netstandard 2.0.

在此处输入图片说明

在此处输入图片说明

Here is the setting in the Function App:

在此处输入图片说明

How can I "upgrade" the version of my local Functions?

I have done some tests on my side and reproduce the message you got. Just like @Connor has said, for function in beta version, the csproj file should include AzureFunctionsVersion as the illustration shows.

在此处输入图片说明

Once the AzureFunctionsVersion parameter is lost, the function will be recognized as using runtime ~1 despite the TargetFramework . So when the project is published to a beta function app in portal, it will remind us of the version change.

I ran into the same problem today during the creation of an Azure Function project in Visual Studio 2019. It needed a lot of sorting out but below turned out to be the solution for me:

In Azure:

  1. Azure > Function App > Create
  2. Then go to the settings and choose the runtime version, which is ~2 by default (meaning a 2.x version with auto updates enabled).

In Visual Studio:

  1. VS Create project type C# > Cloud > 'Azure Functions'. In the second screen don't forget to choose for "Azure Functions v2 (.NET Core)".
  2. Via the nuget package manager update the Microsoft.NET.Sdk.Functions package.
  3. Also install: Microsoft.Azure.WebJobs (v3.0.9)
  4. Also install: Microsoft.Azure.WebJobs.Extensions.Http (3.0.2)

Clean + Rebuild the project. Now you should be able to Publish directly from Visual Studio to the Cloud. Right-click on the project and choose 'Publish'. Then you should see an option to Publish to an Function in Azure cloud.

If not then the most likely reason is because you have a problem with your references / nuget packages / Microsoft SDK. Or the versions of those.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM