Azure Website Continuous Deployment always picks up the wrong project - azure

I have the following folder structure in my TFS online:
The folder names also match the project names in the solution.
Legend:
green dot: web api 2.0 project
red dot: class library
blue dot: console app added as a webjob to the web project
grey dot: console app only used for testing
Working folders for build definition:
The build definition was created automatically by connecting Azure to TFS online, and I have only changed the folder, so instead of the Team Project root folder, it points to the folder of this branch, containing the solution file and the folders in the first picture.
(This points to the folder which contains the solution files as well as all the subfolders from the first image.
Problem:
When I run a build, it always picks up the ExpiringRateCardsWorker project (even now the Web project has been renamed (both the directory and the project file) to start with an underscore, so it will be first alphabetically.
The deployment is successful, this is what I see in Monaco:
How can I make it pick up the web project?
Edit: Question was closed stating to be the duplicate of this. I have since tried the solution suggested there, but the /site/deployments folder is empty on the FTP, it doesn't contain the deploy.cmd, so my question is still not answered unfortunatelly.

I'm experiencing similar problem with deployment of MVC application to Azure using CD in VSO.
This problem is somehow related to WebJob Publishing mechanism.
For now I wasn't able to deploy my whole solution with WebJob in one go, but when I've deleted all webjob *.json files and Microsoft WebJobs Publish NuGet package from my solution, I've managed to deploy my MVC App normally.
I think I'll have to deploy this parts of the application separately, for now.

Related

How to deploy two projects into one Web app - Deploy using sub directory

I have two projects, JavaScript and Angular. I want to have both on the same web app on azure.
The URL will be like:
First Project: www.wholeproject.com
Second Project: ww.wwholeproject.com/secondproject
The projects are on the same git repository.
I created Azure web app and linked it to the first project, so deploying the first one is working and I can see it online. However, I can't manage to publish the second (angular) project having the subdirectory ../secondproject.
I tried adding the .deployment file to the main project, but I couldn't figure out how to proceed.
You should be able to accomplish this on your web app by using virtual directories.
The below two blogs highlight how to setup virtual directories with different URLs and how to deploy to each directory.
http://jaliyaudagedara.blogspot.com/2016/07/deploy-aspnet-core-10-web-application.html
http://chamindac.blogspot.com/2017/06/deploying-web-apps-to-azure-virtual.html
Please let us know if you have any questions or concerns regarding this topic.

Azure project - which subfolders/files should be checked into version control?

I am working on a small Azure project (using Visual Studio 2015). I have created a Azure Cloud service project with only one webjob. Inside the cloud service project, vs2015 created some subfolders like 'csx', 'ecf', 'XXXXXXXXContent', 'Profile', 'rcf'.
I wonder whether I should checkin these subfolders and the files inside. Of course, the 'Release' and 'Debug' folder inside these subfolders won't be checked in.
Folders with lowercases are generated during compilation and publish process.
csx: Packaged files which ready to be published. But as of Azure Tools v1.4, it is no longer generated unless you run in emulator. This blog post describes in detail.
rcf: which stands for Role Content Files. You already has ---WorkerRoleContent and rcf is generated through build configuration. You can think it as a kind of bin folder for contents.
ecf: It is generated folder for diagnostics settings depended on `diagnostics.wadcfgx' file. The file is specific for publish settings, so you should not include it in source control.
Overall, all three folders are automatically generated for publishing and they should not be added to source control.
However, Profile and ----Content folders are required to maintain your publish settings.

Visual studio continuous deployment of a Webapp does not work

I cannot deploy using the build created by the integration between Azure and VSO.
The build finishes correctly, but it is not deployed on the website! The bin folder is there. But there is no folder for the views!
I have the impression it started when I create an webjob in the solution.
I cannot publish it neither!
Thank you
It's possible you're actually publishing the web job (is the project just a console app?) to the webapp, instead of the web project.
(Side note, this is one way to get a web job deployed and running)
You can control which project in your solution is being deployed by adding a new setting under "app settings" on the "configure" tab for the webapp.
The setting you want is Project and it's a relative path from the solution root to the .csproj file of your web project.
Alternatively, you can specify the setting in a custom .deployment file.
Relevant Kudu documentation here
From the documentation:
You can specify the full path to the project file. Note that this is not a path to the solution file (.sln), but to the project file (.csproj/.vbproj). The reason for this is that Kudu only builds the minimal dependency tree for this project, and avoids building unrelated projects in the solution that are not needed by the web project.
Here is an example:
[config]
project = WebProject/WebProject.csproj

Is there a way I can publish an exe file to be in the same directory as an azure web job?

I have a web job that uses an exe that is best called when it is sitting in a directory and can be located. The problem is that I don't know how to get this exe to be published with the web job. I tried using a resources folder in the webjob project and copying them to output directory but that didn't upload them and so the only other option I can think of is uploading the files to a non temporary directory on the web site but that is leaking the encapsulation of the web job.
Any thoughts?
When you use visual studio to publish a webjob, it publishes all its dependencies as well. ie VS pushes all the dependencies available under the bin folder. So, add a reference to the dependent project and VS will take care of publishing this dependency as well.

Create Web Deployment zip file from TFS build

Using TFS 2010 and I have a build project consisting of 2 solutions. One is a MVC solution with web pages the other is a solution containing multiple projects. These are various WFC services. I have added the criteria to publish each project in both solutions.
If I build either of them from VS - I get the zip files created.
If I use msbuild from a command prompt and build the WFC solution - I get the zip files.
Same for the MVC.
I then have a build project that builds both solutions, and I have as parameters
/p:DeployOnBuild=true;DeployTarget=Package
When I submit that build - it completes. But in the "_PublishedWebsites" folder I only get a package for the MVC project.
I've tried a LOT of variations but can't get the WFC solution to create the packages for the projects. I even named the pubxml files the same in each WFC project and tried passing that in as another parameter but the same results - MVC is correct; nothing for the WFC.
Even tried changes to Debug|AnyCPU versus Debug|Any CPU (space added).
I am thinking I have some little thing off that is biting me - but I can't find it.
Appreciate any assistance!
The WCF projects need to have been created as Web Applications and not just Websites. The default behavior you want is only available in Web Application.
There is walkthough on how to do the conversion on MSDN (http://msdn.microsoft.com/en-us/library/aa983476(v=vs.90).aspx). I tend to modify the documentation to be an in place upgrade by creating a blank web application and copying the project file over the top of the existing location.
You can then open that new project in VS (giving you two views of the same thing) and then adding the hidden files. Once working you can then delete the WebSite project and you will be left with thebWeb Application that will output to _PublishedWebsites.

Resources