0

I have tried to create two different zip for each project by adding two vsBuild tasks.

While writing my yaml based pipeline I am facing two issue:-

  1. In webjob project path is DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\App_Data\jobs\continuous\somethingApp.zip" but nothing is getting added into it.

2 When I am deploying it azure app service, during deployment of my web app I am facing below error:

at ExecState._setResult (D:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\3.179.0\node_modules\azure-pipelines-task-lib\toolrunner.js:828:25)
    at ExecState.CheckComplete (D:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\3.179.0\node_modules\azure-pipelines-task-lib\toolrunner.js:811:18)
    at ChildProcess.<anonymous> (D:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\3.179.0\node_modules\azure-pipelines-task-lib\toolrunner.js:733:19)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)

Hence not able deploy anything although Pipeline completing successfully.

Vito Liu
  • 7,525
  • 1
  • 8
  • 17
Mukeem Ahmed
  • 93
  • 1
  • 2
  • 11
  • Hi, The first issue seems that you miss an argument and it do not create the zip file. For the second issue, could you please share the detail deploy log here? We need check it and locate the issue. Thanks – Vito Liu Nov 27 '20 at 08:12
  • @VitoLiu-MSFTmy goal is to create my artifact as Drop which has AppData for webjob and webApiZip for web application . So that I could deploy it. I have done it using DotNetCoreBuild build but now I am trying to do it VsBuild@1 by creating yaml. I don't want zip for webjob actually. – Mukeem Ahmed Nov 27 '20 at 11:55
  • Hi, Do you mind sharing you yaml build definition here? In addition, you say nothing is getting added into it. This means that you added the task publishing artifact to publish the artifact, but you can't find any files in Drop, right? – Vito Liu Nov 30 '20 at 06:00
  • @VitoLiu-MSFT thank for constantly replying. Files were getting added into drop. Zip file was also creating successfully for my main app which is an web api project but zip file for wejob was not correct although it was getting added into drop. But the problem is solved as I don't have to create zip for webjob project. I just created its but copied it into artifactstagingDictoray to publish.. – Mukeem Ahmed Dec 01 '20 at 06:06
  • 1
    Hi, Do you mean that you add the task copy file before publish artifact? Could you please convert your comment into an answer and accept it as the answer? It could help other community members who get the same issues. Thanks – Vito Liu Dec 01 '20 at 06:42

3 Answers3

1

The key to the problem, I think it should be a path configuration problem, unable to access your webjob application.

So I suggest you create a virtual application in portal.

enter image description here

For more details, you can refer to this blog. If you need further help, please let me know.

How to publish webjob from azure devops to azure app service using Azure app service deploy task

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
1

but nothing is getting added into it

If you just add below MSBuild Arguments in your vsBuild task, then it will create the zip file and save output file in the zip file

/p:WebPublishMethod=Package /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\App_Data\jobs\continuous\somethingApp.zip"
Vito Liu
  • 7,525
  • 1
  • 8
  • 17
1

Basically there are two possible solutions for the situation in which you are supposed to deploy web api and webjob .NET CORE projects to azure webapp service:-

  1. If you are using VSBuild task to build you solution then simply build your both projects and create zip file for your deployable webApi project and before publishing your drop artifact, make sure you copy webjob projects build file(.dll etc) into artifactstagingDirectory in in the format as 'App_Data\jobs\continuous(or triggered)\yourFiles' and then deploy your artifact to azure app service. Hope this should work.

  2. While the other way of doing this is, Build your DOTNET Core projects using DOTNETCORECLI task do in below way

    `

  • task: DotNetCoreCLI@2 inputs: command: 'publish' publishWebProjects: true arguments: '--configuration $(buildConfiguration) --output $(build.artifactStagingDirectory)\yourwebApiProjectName.zip'

    - task: DotNetCoreCLI@2
      inputs:
        command: 'publish'
        publishWebProjects: false
        projects: '**/yourWebJobProjectName.csproj'
        arguments: '--configuration $(buildConfiguration) --output $(build.artifactStagingDirectory)\App_Data\jobs\continuous\yourWebJObName'
        zipAfterPublish: false
        modifyOutputPath: false
    
    - task: PublishBuildArtifacts@1
      inputs:
        PathtoPublish: '$(Build.ArtifactStagingDirectory)'
        ArtifactName: 'drop'
        publishLocation: 'Container'`
    

Then you can deploy this artifact at your azure app service. Hope this will resolve issue related to deployment of DOTNET Core based webjob and webapi project at azure web app service.

Mukeem Ahmed
  • 93
  • 1
  • 2
  • 11