Trouble deploying WebJob with Azure Web site

I have added a nuspec file to my Web project and added a files element to try and include the executable for the webjob in the Web Project so the website and webjob can be deployed together to Azure. I’m following this article - http://withouttheloop.com/articles/2015-06-23-deploying-custom-services-as-azure-webjobs/ so I’ve also added OctoPackEnforceAddingFiles to the web project’s csproj file.

The Octopus build fails as it can’t find those files I refer to.

[CreateOctoPackPackage] error OCTONUGET: Could not find a part of the path ‘D:\BuildAgent03\work\8618d862620640ee\Source\CrisisManagerWorker\bin\release’

I’m having trouble working out where to go from here. I have checked D:\BuildAgent03\work but it is empty. I’ve attached my nuspec file. Thanks!

CrisisManager.Web.nuspec (478 Bytes)

build log attached

CrisisManager_1._Feature_Branches_1.0.0.255.log (506 KB)

Hi Matthew,
My immediate suspicion is that your WebJob project isn’t actually getting built before OctoPack runs as part of your WebApp and tries to package it all up together. Octopack to be able to access the WebJob source files TeamCity needs to have built that project before the WebApp. This sounds more like a project reference configuration issue. Could you make sure that either the WebApp references the WebJob as a dependency, forcing it to be built first, or create a separate project that references the two of them.
If in doubt the TeamCity logs should indicate if the WebJob project has successfully built first.
Give that a go and let me know if you get stuck again.
Cheers,
Robert

Hi Matthew,
Checking your logs it looks like my suspicions are probably correct since only a few lines after the failed package, that the CrisisManagerWorker project actually starts to build.
It needs to be built before it can be packaged up :slight_smile:
Cheers,
Rob

Thanks Robert! That worked :slight_smile:

Matthew Mortensen
IS Development Manager

GHD
T: 61 7 33163726 | V: 413726 | E: matthew.mortensen@ghd.commailto:matthew.mortensen@ghd.com
145 Ann St Brisbane QLD 4000 Australia | http://www.ghd.com/

WATERhttp://www.ghd.com/sectors/water/ | ENERGY & RESOURCEShttp://www.ghd.com/global/sectors/energy--resources/ | ENVIRONMENThttp://www.ghd.com/sectors/environment/ | PROPERTY & BUILDINGShttp://www.ghd.com/global/sectors/property--buildings/ | TRANSPORTATIONhttp://www.ghd.com/global/sectors/transportation/
Please consider the environment before printing this email