简体   繁体   English

如何从 Visual Studio 在 Linux 上部署 Azure Function 应用程序

[英]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.

相关问题 在 Visual Studio 中将 .net 核心应用程序部署到 linux? - Deploy .net core app to linux in visual studio? 如何在Windows上的Visual Studio中编写CUDA并将其部署到Linux? - How can I write CUDA in Visual Studio on Windows and deploy it to Linux? 如何构建 netcore 3.0 Webapi 并部署到 Azure Linux 应用服务 - How to build a netcore 3.0 Webapi and deploy to an Azure Linux app service 从Linux动态库/ Linux控制台应用程序导出/导入C ++函数| Visual Studio Linux项目 - Exporting / Importing C++ Functions from Linux Dynamic Library / Linux Console App | Visual Studio Linux Projects 将Visual Studio中的C#Stateful Service Fabric应用程序部署到Linux - Deploy a C# Stateful Service Fabric application from Visual Studio to Linux Azure Linux 应用服务:从 Devops 管道部署后安装包 - Azure Linux App Service : Installing packages after deploy from Devops pipeline 无法在 Azure 应用服务 Linux 中部署 NodeJS(Fastify 应用) - Unable to deploy NodeJS (Fastify app) in Azure App Service Linux 使用C ++和visual studio的Linux应用程序 - Linux app using C++ and visual studio 如何在Visual Studio 2010中从Linux进行远程编译和调试 - How to remotely compile and debug in Linux from within Visual Studio 2010 如何在单个基于 linux 的 azure 应用服务中部署多个 .net 核心应用程序 - how to deploy multiple .net core application in single linux based azure app service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM