I created a (Git) repo on Visual Studio Online, and put a solution with two projects in it:
- An empty web project
- A command line app that did something trivial
I right-clicked on the web project and chose "Add > Existing Project as Azure WebJob" and went through the Wizard. This added the Microsoft.Web.WebJobs.Publish package to both, along with some json config files. I pushed everything and waited for it to build.
When it turned up on Azure, there was no App_Data folder, and therefore, the job did not work. I believe the .targets
added by Microsoft.Web.WebJobs.Publish is supposed to set this all up to build correctly.
I even tried changing my command line app to build directly into (website)\App_Data\Jobs\Continuous\MyJob
. However, once again, once it hits Azure, there is no App_Data
folder (the VS Online build logs do show my exe going into the App_Data folder).
How do I get this working? Ideally I'd like to skip the NuGet packages (I want to totally understand what's going on, rather than just pulling in a ton of libraries), but ultimately, I'll settle for working over not!
AppHarbor was able to run simple .exes as background jobs many years ago, I'm sure it shouldn't be this complicated.
Build logs
Here's some parts of the build log, that show the job going to the right folder (note: the website part is deployed fine):
2015-08-01T20:55:51.5459770Z 2>_CopyFilesMarkedCopyLocal:
2015-08-01T20:55:51.5479760Z Copying file from "C:\a\537fbab6\TuppenySlackBot\packages\SimpleSlackBot.0.1.0.0\lib\net452\SimpleSlackBot.dll" to "..\SlackBotRedirect\App_Data\Jobs\Continuous\TuppenySlackBot\SimpleSlackBot.dll".
2015-08-01T20:55:51.5489762Z _CopyAppConfigFile:
2015-08-01T20:55:51.5489762Z Copying file from "App.config" to "..\SlackBotRedirect\App_Data\Jobs\Continuous\TuppenySlackBot\TuppenySlackBot.exe.config".
2015-08-01T20:55:51.5499768Z CopyFilesToOutputDirectory:
2015-08-01T20:55:51.5509761Z Copying file from "obj\Debug\TuppenySlackBot.exe" to "..\SlackBotRedirect\App_Data\Jobs\Continuous\TuppenySlackBot\TuppenySlackBot.exe".
2015-08-01T20:55:51.5519765Z TuppenySlackBot -> C:\a\537fbab6\TuppenySlackBot\SlackBotRedirect\App_Data\Jobs\Continuous\TuppenySlackBot\TuppenySlackBot.exe
2015-08-01T20:55:51.5519765Z Copying file from "obj\Debug\TuppenySlackBot.pdb" to "..\SlackBotRedirect\App_Data\Jobs\Continuous\TuppenySlackBot\TuppenySlackBot.pdb".
2015-08-01T20:55:51.5569769Z 2>Done Building Project "C:\a\537fbab6\TuppenySlackBot\TuppenySlackBot\TuppenySlackBot.csproj" (default targets).
2015-08-01T20:55:51.5589764Z 1>Done Building Project "C:\a\537fbab6\TuppenySlackBot\TuppenySlackBot.sln" (default targets).
Azure directory listing
When I go to the web site in the Azure portal, click Tools, then Console and run dir
, there is no App_Data
_ _____ _ ___ ___
/_\ |_ / | | | _ \ __|
_ ___/ _ \__/ /| |_| | / _|___ _ _
(___ /_/ \_\/___|\___/|_|_\___| _____)
(_______ _ _) _ ______ _)_ _
(______________ _ ) (___ _ _)
Manage your web app environment by running common commands ('mkdir', 'cd' to change directories, etc.) This is a sandbox environment, so any commands that require elevated privileges won't work.
D:\home\site\wwwroot
> dir
D:\home\site\wwwroot
Volume in drive D is Windows
Volume Serial Number is C83A-45BE
Directory of D:\home\site\wwwroot
08/01/2015 08:34 PM <DIR> .
08/01/2015 08:34 PM <DIR> ..
08/01/2015 07:58 PM <DIR> bin
08/01/2015 08:59 PM 1,621 BuildInfo.config
08/01/2015 06:35 PM 202,392 hostingstart.html
08/01/2015 08:47 PM 157 packages.config
08/01/2015 08:34 PM <DIR> Properties
08/01/2015 08:59 PM 240 Web.config
4 File(s) 204,410 bytes
4 Dir(s) 1,073,143,808 bytes free
(It's correct that this site only has a Web.config, it just redirects, as I'm only interested in the job. The Web.config has the correct content).
Edit: I think this is the same issue posted here that has no resolution posted.