Publishing to Azure Websites from Visual Studio Online TFS repository

Jan 9, 2014 at 8:34 PM
Has anyone been able to setup continuous integration deployments for one of these node.js tools for VS template projects to Azure Websites using Visual Studio Online source control--TFS or git? I can't get either to work.

The .njsproj references Microsoft.NodejsTools.targets from my local install that does not seem to be on the build servers. But even when I work around that by copying it into the project and source control and updating the build reference so that it "compiles", I get:

Exception Message: Could not find a part of the path 'C:\a\bin_PublishedWebsites'. (type DirectoryNotFoundException)
Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

I'm assuming the issue is creating a deployment package. So I tried adding Microsoft.WebApplication.targets (which I stole from an ASP.NET project) to the build script but that changed nothing.

I'd really like to have continuous deployment working in this scenario.

More detail:

After installing Node.js Tools for Visual Studio, I created a node project (I tried the empty web app and the express app). I ran it locally, it works fine. Then I created a project on Visual Studio Online and added the code to source control. When using TFS for source control, I added the node_modules folder contents to source control but I left that out when using git. I setup an Azure Website to deploy from source control and pointed it at the right repository. Again, I tried both TFS and git with this process.

Just to be sure I wasn't missing something fundamental, I did all of this some process with a new ASP.NET MVC project and it works great.
Jan 10, 2014 at 12:00 AM
Hi Jeff,

We are aware that this is not working right now, we have a work item for it here (please vote):

We haven't tried to 'hack it' like you did by bundling the targets file to see if it would work.

I'm curious if you are using 1.0 Alpha or DevBuild 2013-12-17 ( Some additional 'build' related fixes went in that build, so you may have a better chance with it.
Feb 24, 2014 at 1:05 PM
I tried this with the latest dev build but it still doesn't work.

I haven't been able to make any continuous deployment strategy work with node.js and azure which is a big show stopper.
Having a local git repository for a azure web site seems to do the deployments but the web site doesn't actually update. Only manual publish updates the web site correctly.

I'm currently evaluating azure services for a node.js project.
Feb 24, 2014 at 6:29 PM
Hi Baastax,

Can you elaborate on "web site doesn't actually update"? Do you need to manually restart the server through the portal to see the changes after a Git deployment?

If it's just not working with Git even with a restart: Are you using the VS integrated Git support? I'm going from memory here, but I believe that you need to uncheck 'Create directory for solution' when you create your Node.js project, to avoid having an extra subfolder at the root of the Git repository.
Feb 25, 2014 at 5:35 AM
Edited Feb 25, 2014 at 5:56 AM
Basically even the site restart doesn't help. I have to manually do a publish from visual studio 2013 for the site to update. Then it updates immediately. I am using the integrated support.

Thanks for the tip, I'll try that next!


It's working now after I unticked the dir box. Thanks!
Jan 15, 2015 at 7:53 PM
Is this issue solved? I'm having exactly the same issue. I created a project from azure node.js express 4 template and the continuous build/publish from visual studio online TFS fails with the same error. A stackoverflow entry mentioned that unlink the TFS deployment from azure portal, clean up, and link again solved the problem but didn't work for me.
Jan 15, 2015 at 10:03 PM
Addressed the problem by following the link below and reading the comments.