0

I created a (Git) repo on Visual Studio Online, and put a solution with two projects in it:

  1. An empty web project
  2. 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.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
  • Did you use Kudu to check for the existence of the job? – Maria Ines Parnisari Aug 01 '15 at 21:26
  • I used the Console button in the Tools section in Azure, which let me see the file system. There was no App_Data folder :( – Danny Tuppeny Aug 01 '15 at 21:33
  • Check the build output (it'll tell you the site and directory it's publishing to) and ensure you're publishing to the intended WebApp (WebSite). When managing multiple websites is easy to get mixed up. – Brent Newbury Aug 01 '15 at 21:54
  • @BrentNewbury I don't have multiple sites, only one. The build works fine and logs show the job building into the correct folder. The problem seems to be that when Azure is taking the output of the build, it isn't taking the App_Data folder (that, of VSOnline deleted it). I don't really know how this Azure<->VSOnline deployment bit works, and there doesn't seem to be much visibility of it? – Danny Tuppeny Aug 02 '15 at 08:34
  • I've updated the post with build log + dir output from Azure. – Danny Tuppeny Aug 02 '15 at 08:41
  • See this: http://stackoverflow.com/questions/27067724/azure-webjobs-deployment-with-continuous-integration-on-visual-studio-online. Apparently, it's a bug. – Maria Ines Parnisari Aug 02 '15 at 19:21
  • Wow... That was like 9 months ago :( – Danny Tuppeny Aug 02 '15 at 19:54

1 Answers1

0

I chatted with the VSO team about this some time back. They informed me that the VSO team has extended their build functionality considerably. They asked that I direct anyone else who has this issue to this site: https://msdn.microsoft.com/Library/vs/alm/Build/azure/index

brady gaster
  • 1,506
  • 1
  • 10
  • 15