简体   繁体   English

如何使用Azure DevOps部署多个应用程序?

[英]How to deploy multiple apps with Azure DevOps?

I have a .NET solution that contains several projects. 我有一个包含几个项目的.NET解决方案。 I want to set up a deployment pipeline in Azure DevOps but I'm not sure how to do this. 我想在Azure DevOps中设置部署管道,但我不知道如何做到这一点。 I want to have 1 pipeline that deploys the following projects: 我想拥有一个部署以下项目的管道:

  • Main web app -> needs to go to Azure Web Apps 主Web应用程序 - >需要转到Azure Web Apps
  • Portal web app -> also needs to go to Azure Web Apps 门户网站应用程序 - >还需要转到Azure Web Apps
  • Database -> needs to be deployed to SQL Azure Database 数据库 - >需要部署到SQL Azure数据库

How do I set this up? 我该如何设置? I selected the default 'Azure App Service Deploy' template, but in the deployment task I cannot select which project I want to deploy. 我选择了默认的“Azure App Service Deploy”模板,但在部署任务中,我无法选择要部署的项目。 The package refers to $(build.artifactstagingdirectory)/**/*.zip , but this is a zip file that contains the artifacts for both my web projects (and the database DACPAC is missing here). 该包引用$(build.artifactstagingdirectory)/**/*.zip ,但这是一个zip文件,其中包含我的两个Web项目的工件(此处缺少数据库DACPAC)。

First things first. 首先要做的事情。 Copy the build artefacts into 3 different packages. 将构建工件复制到3个不同的包中。 Say, 说,

  • Artefacts1: For Web Apps Artefacts1:适用于Web Apps

  • Artefacts2: For Portal Apps Artefacts2:门户应用程序

  • Artefacts3: For DACPAC files Artefacts3:用于DACPAC文件

In this case you will have 3 copy files task copying and 3 publish build artefacts task to publish it to Azure DevOps. 在这种情况下,您将有3个复制文件任务复制和3个发布构建工件任务,以将其发布到Azure DevOps。 In the release pipeline, add 3 agent jobs to perform 在发布管道中,添加3个代理作业以执行

  • Deploy to Web App 部署到Web App
  • Deploy to Portal App 部署到Portal App
  • Database DACPAC Deploy 数据库DACPAC部署

You can refer this to have similar pipeline. 您可以参考有类似的管道。

that's many questions in one, but I'd generally separate build\\release pipelines for each application (that way you have more control) and you dont have the problem of how to select proper zip file. 这是一个很多的问题,但我通常会为每个应用程序分离build \\ release管道(这样你有更多的控制权),你没有如何选择合适的zip文件的问题。 I'm pretty sure you cant even select a part of zip file (since you now have a single zip file with several solutions), so your approach is not going to work. 我很确定你甚至不能选择zip文件的一部分(因为你现在有一个包含多个解决方案的zip文件),所以你的方法不会起作用。

as for how to set this up: your build should build 1 project exactly and pack\\upload it. 至于如何设置它:你的构建应该完全构建1个项目并打包\\上传它。 and then your release will target that artifact and everything will work just fine. 然后你的发布将针对该工件,一切都会正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为具有多个Web应用程序的解决方案自定义“ ASP.NET CORE(完整框架)”构建定义模板,并将每个部署在Azure上 - How to customize “ASP.NET CORE (Full framework)” build definition template for a solution with multiple web apps and deploy each on Azure 使用visual studio团队服务构建包含多个Web应用程序的解决方案,并将这些Web应用程序部署到azure - using visual studio team services to build a solution containing multiple web apps and deploy these web apps to azure 如何在Azure中部署多个Web角色 - How to deploy multiple web roles in Azure 如何使用基于Azure资源管理器的PowerShell部署Azure Web Apps? - How to deploy Azure Web Apps using Azure Resource Manager-Based PowerShell? 如何将具有多个组件的应用程序部署到Azure? - How do I deploy an app with multiple components to Azure? 如何在一个Azure Web App上托管多个应用程序 - How to host multiple apps on one Azure Web App 我可以从 Azure DevOps 中的存储库直接部署到 Azure 虚拟机吗? - can I deploy directly to Azure Virtual Machine from repository in Azure DevOps? 将多个网站部署到一项Azure服务 - Deploy multiple Web Site to one Azure service 如何部署到Azure云服务 - How to deploy to Azure Cloud Service Web部署具有多个实例的Azure Web角色 - Web deploy azure web role with multiple instances
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM