将多个项目部署为一个 Azure WebJob 解决方案。

huangapple go评论108阅读模式
英文:

Deploying one solution with multiple projects to one Azure WebJob

问题

I have created a WebJob in Azure that receives and aggregates/stores data from a sensor. At first (when I only had one project in my solution), I just ran dotnet build -c Release and uploaded those build files to the Azure Portal. That worked fine.

Eventually I started to change the folder structure etc so now the solution has 3 projects, with one startup project (ReceiverWebJob). See below:

将多个项目部署为一个 Azure WebJob 解决方案。

How can I deploy those 3 projects in just one Azure WebJob?

UPDATE: According to @Harshitha, It is still possible to use the dotnet build -c Release command. I tried this and uploaded the created files from every project's bin/Release/net6.0 folder. The WebJob now runs without any problems.

UPDATE 2: Also according to @Harshitha it should also be possible to use an Azure Pipeline for App Service Deployment tasks. I will try this when I have finished my feature.

英文:

I have created a WebJob in Azure that receives and aggregates/stores data from a sensor. At first (when I only had one project in my solution), I just ran dotnet build -c Release and uploaded those build files to the Azure Portal. That worked fine.

Eventually I started to change the folder structure etc so now the solution has 3 projects, with one startup project (ReceiverWebJob). See below:

将多个项目部署为一个 Azure WebJob 解决方案。

How can I deploy those 3 projects in just one Azure WebJob?

UPDATE: According to @Harshitha, It is still possible to use the dotnet build -c Release command. I tried this and uploaded the created files from every project's bin/Release/net6.0 folder. The WebJob now runs without any problems.

UPDATE 2: Also according to @Harshitha it should also be possible to use an Azure Pipeline for App Service Deployment tasks. I will try this when I have finished my feature.

答案1

得分: 1

查看以下步骤以在单个 Azure WebJob 中运行多个项目。

  • 创建一个控制台应用程序。如您所提到的,我选择了.NET 6控制台应用程序。

  • 在同一应用程序中添加2个新项目。

  • 转到每个项目的根目录,对每个单独的应用程序运行"dotnet build -c Release"命令。

  • 应用程序将被编译,dll文件将被创建在一个"release"文件夹中。

  • 现在将生成的所有文件合并到一个新目录中。将该文件夹压缩为ZIP文件。

  • 创建一个新的Azure App Service。

  • 在"App Service"的"设置"下选择"WebJobs",并添加一个新的"WebJob"。

  • 浏览ZIP文件夹并添加一个新的"Web Job"。

英文:

Check the below steps to run multiple projects in a single Azure WebJob.

  • Create a Console Application.As you have mentioned I have taken .NET 6 Console Application.

  • With in the same Application add 2 new projects.

  • Navigate to each project root directory and run the dotnet build -c Release command on each individual Application.

将多个项目部署为一个 Azure WebJob 解决方案。

  • Application will be compiled and dlls will be created in a release folder.

将多个项目部署为一个 Azure WebJob 解决方案。

  • Now combine all the files generated in a release folder into a new directory. Zip that folder.

  • Create a new Azure App Service.

  • Select WebJobs under Settings of the App Service and add a new WebJob.

  • Browse the zipped folder and add a new Web Job.

将多个项目部署为一个 Azure WebJob 解决方案。

huangapple
  • 本文由 发表于 2023年3月15日 17:44:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/75742934.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定