Azure Function App-尝试从v2工具发布到v1函数应用程序 [英] Azure Function App - trying to publish to a v1 function app from v2 tooling

查看:189
本文介绍了Azure Function App-尝试从v2工具发布到v1函数应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建并成功测试了功能应用。
由于具有旧版库,因此需要.net Framework,并将其设置为使用运行时版本〜1。使用发布配置文件直接从Visual Studio 2017进行发布正常工作。但是,尝试使用Azure CLI进行发布使我感到悲伤。

I've created and successfully tested a Function App. It requires the .net Framework because of a legacy library, and is set to use run-time version ~1. Publishing directly from Visual Studio 2017 using the publishing profile works normally. However, attempting to publish with the Azure CLI is giving me grief.

在此处跟随MS文章:
https://docs.microsoft.com/zh-cn/azure / azure-functions / functions-create-first-azure-function-azure-cli

Following the MS article here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function-azure-cli


  • azure-cli v2.0.64

  • azure-functions-core-tools@2.7.1158(npm)

  • .NET Framework 4.8 DevPack

>func azure functionapp publish <myApp>
You're trying to publish to a v1 function app from v2 tooling.
You can pass --force to force update the app to v2, or downgrade to v1 tooling for publishing

如何降级我的工具?

推荐答案

来自 github 似乎是您需要安装较低版本的

From github seems to be that you need to install lower version like

要使用npm安装v1:

To install v1 with npm:

npm i -g azure-functions-core-tools@1

另一种方法就是简单地使用msbuild

The other way would be simply using msbuild

"msbuild.exe" "SOLUTIONNAME_OR_PROJECT"  /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="WebApp.zip" /p:DeployIisAppPath="Default Web Site" /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="15.0"

这将产生具有天蓝色功能的zip

This will produce zip with you azure function

这篇关于Azure Function App-尝试从v2工具发布到v1函数应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆