[英]How to deploy Azure Function App on Linux from Visual Studio
How can i deploy an Azure Function App V2 to an existing Linux Function App Plan in Azure from Visual Studio 2019? How can i deploy an Azure Function App V2 to an existing Linux Function App Plan in Azure from Visual Studio 2019?
When i select "Select existing" from the publish-dialog in Visual Studio i only see my windows-based functions in my connected Azure Subscription, but the Linux one i created in the same subscription is missing.当我 select 从 Visual Studio 的发布对话框中“选择现有”时,我只能在我连接的 Azure 订阅中看到我的基于 Windows 的功能,但 ZEDC9F0A5A5D57797BF68E3736474381 中创建的订阅相同。
When i download the publishing profile for the function app, import this and try to publish this way, i get an error which is not very helpful imho:当我下载 function 应用程序的发布配置文件时,导入此文件并尝试以这种方式发布,我收到一个错误,恕我直言,这不是很有帮助:
System.AggregateException: One or more errors occurred. ---> System.Exception: Publishing failed.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.Publish.Framework.Model.DefaultPublishSteps.<>c__DisplayClass26_0.<IsBuildCompletedSuccessfully>b__2()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Publish.Framework.Model.DefaultPublishSteps.<DefaultCorePublishStep>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__202.MoveNext()
---> (Inner Exception #0) System.Exception: Publishing failed.<---
System.Exception: Publishing failed.
What is the way to publish a C# Azure Function to a Azure Functions running on Linux? What is the way to publish a C# Azure Function to a Azure Functions running on Linux?
1.right click your project in Visual Studio. 1.在 Visual Studio 中右键单击您的项目。 Select 'Open Floder in File Explorer'.
Select '在文件资源管理器中打开 Floder'。
2.Press the win and R keys at the same time, then type "cmd" and click OK. 2.同时按下win键和R键,输入“cmd”,点击确定。
3.Go to the folder where the project is located. 3.Go到项目所在文件夹。
4.Then use func azure functionapp publish <APP_NAME>
. 4.然后使用
func azure functionapp publish <APP_NAME>
。 (each <APP_NAME>
is unique on Azure. in myside, it's name is linuxFunctionAppBowman, you can use the name that you created before.) (每个
<APP_NAME>
在 Azure 上都是唯一的。在 myside,它的名称是 linuxFunctionAppBowman,您可以使用您之前创建的名称。)
5.Function been deployed. 5.Function 已部署。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.