在Azure DevOps版本定义中从同一项目部署多个WebJob? [英] Deploying Multiple WebJobs from the Same Project in a Azure DevOps Release Definition?

本文介绍了在Azure DevOps版本定义中从同一项目部署多个WebJob?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我们构造代码的方式是,我们在解决方案中有几个项目,每个项目都有多个webjob.我们已经配置了手动方式,使用run.cmd文件释放这些多个webjob,然后根据要尝试释放的webjob将相关的run.cmd文件复制到根文件夹.

So the way that we've structured our code is that we've got several projects in our solution that each have multiple webjobs. We've configured a manual way of releasing these multiple webjobs using the run.cmd files and copying over the pertinent run.cmd file to the root folder depending on which webjob we're trying to release.

我想知道是否有任何方法可以通过Azure DevOps中的生成/发布定义来执行此操作,而不必将多个Webjob分解为单个项目.这些多个Web作业也都生活在同一个App Service中.

I'm wondering if there is any way to do this via a build/release definition in Azure DevOps without having to tear apart the multiple webjobs into individual projects. These multiple webjobs also all live in the same App Service.

推荐答案

您所做的是目前最简单的方法,您可以在Azure DevOps生成/发布管道中克隆该过程.在Azure DevOps中,没有任何方法可以不必将多个Web作业分解为单个项目.

What you have done is the simplest way at present, you could just clone the process in Azure DevOps Build/Release Pipeline. There is not any way to do this in Azure DevOps without having to tear apart the multiple webjobs into individual projects.

我们已经配置了手动释放这些多个Web作业的方式使用run.cmd文件并将相关的run.cmd文件复制到根文件夹,具体取决于我们要释放的Webjob.

We've configured a manual way of releasing these multiple webjobs using the run.cmd files and copying over the pertinent run.cmd file to the root folder depending on which webjob we're trying to release.

例如,在构建解决方案步骤中定义(添加一些复制文件步骤以复制必要的文件):-

For example, in your build solution step define (add some copy file step to copy necessary files) :-

  1. Visual Studio Build(解决方案:***.sln,MSBuild参数:/p:DeployOnBuild = true/p:WebPublishMethod =包装/p:SkipInvalidConfigurations = true/p:PackageLocation ="$(build.artifactstagingdirectory)\")

  1. Visual Studio Build (Solution: ***.sln, MSBuild Arguments: /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\")

发布构建工件(发布路径:$(build.artifactstagingdirectory);工件名称:drop;工件类型:Server)

Publish Build Artifacts (Path to Publish: $(build.artifactstagingdirectory); Artifact Name: drop; Artifact Type: Server)

为此构建定义创建发布定义并添加任务

Create a release definition for this build definition and add a task

  1. Azure App Service部署
  2. 选择您的Azure订阅和应用程序服务名称;
  3. 选择您的包裹或文件夹:$(System.DefaultWorkingDirectory)** \ WebJob1.zip

您可以类似地为WebJob2.zip创建另一个Azure App Service Deploy任务,并通过单个生成和发布管道部署所需的任意多个Webjob.

You can similary create another Azure App Service Deploy task for WebJob2.zip and deploy as many webjobs you want through a single build and release pipeline.

这篇关于在Azure DevOps版本定义中从同一项目部署多个WebJob?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆