英文:
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:
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:
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.
- Application will be compiled and dlls will be created in a
release
folder.
-
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
underSettings
of theApp Service
and add a newWebJob
. -
Browse the zipped folder and add a new
Web Job
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论