使用VSO在同一sln中部署azure网站和webjobs-错误-只能有一个 [英] Deploy azure website and webjobs in same sln using VSO - Error - There can be only one

查看:69
本文介绍了使用VSO在同一sln中部署azure网站和webjobs-错误-只能有一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在同一个sln中访问了一个网站和一个webjob项目:

I've got to a website and a webjob project in the same sln:

  • Sritt(网站)
  • Sritt.Webjob

Sritt的属性中,具有webjobs-list.json并具有以下设置:

In properties of Sritt theres a webjobs-list.json with the following setting:

"WebJobs": [
    {
      "filePath": "../Sritt.WebJob/Sritt.WebJob.csproj"
    }

我已经通过VSTS构建了这样的构建(使用新的构建系统):​​

I've configured the by VSTS build like this (with the new buildsystem):

Solution: **\*.sln    
MSBuild Args: /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.stagingDirectory)"

在VSTS中进行构建会给我以下警告:

Building in VSTS gives me the following warning:

 C:\a\1\s\packages\Microsoft.Web.WebJobs.Publish.1.0.9\tools\webjobs.console.targets(149,5): warning : WebJob schedule for SrittWebJob will not be created. WebJob schedules can only be created when the publish destination is an Azure Website [C:\a\1\s\Sritt.WebJob\Sritt.WebJob.csproj]

以及以下错误:

packageFile= Find-Files -SearchPattern C:\a\1\a\**\*.zip
packageFile= C:\a\1\a\Sritt.WebJob.zip C:\a\1\a\Sritt.zip
Found more than one file to deploy with search pattern 'C:\a\1\a\**\*.zip'. There can be only one.  

如何同时部署网站和Webjob?我需要将它们拆分为不同的解决方案吗?

How can I deploy both the website and the webjob? Do I need to split them into different solutions?

推荐答案

似乎您正在使用"Azure Web App部署"任务来部署项目.您无需将它们拆分为不同的解决方案,但需要将它们部署在单独的任务中.

Seems you are using "Azure Web App Deployment" task to deploy the project. You don't need to split them into different solutions but you need to deploy them in separate tasks.

因此,您需要在构建定义中再添加一个"Azure Web App部署"任务.除"Web Deploy软件包"部分外,这两项任务的设置几乎相同: 一个是"$(build.artifactstagingdirectory)\ ** \ Sritt.zip",另一个是"$(build.artifactstagingdirectory)\ ** \ Sritt.WebJob.zip".

So you need to add one more "Azure Web App Deployment" task in you build definition. The setting is almost the same for these two tasks except the "Web Deploy Package" section: One is "$(build.artifactstagingdirectory)\**\Sritt.zip" and another one is "$(build.artifactstagingdirectory)\**\Sritt.WebJob.zip".

这篇关于使用VSO在同一sln中部署azure网站和webjobs-错误-只能有一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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