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:-
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.
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:
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.
While the other way of doing this is, Build your .NET Core projects using .NET Core CLI 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 .NET Core based webjob and Web API project at Azure Web app service.