This is an old question, so I give an updated answer with more details, since I just worked on setting up Kudu on the internal deployment server. The currently selected answer only applies if you are directly using Kudu from the development environment.
If you are deploying a production-type environment and don’t want to install Visual Studio on the target server, there is a good guide on the project website on github.
https://github.com/projectkudu/kudu/wiki/Deploying-to-a-server
On the target server you will need to install:
Go back to your development machine, clone the git repository and create using the build.cmd file, following the instructions in the link above.
When running build.cmd, I had several test crashes that blocked the build when creating artifacts. All of them were associated with Mercurial, which we do not use. Installing the Mercurial client didn’t make them magically leave, so I turned off the tests, and did not plunge a lot of time into debugging my environment.
Your assembly will display failures. I am disabled by commenting on the [Fact] attribute. These are the tests that I disabled:
- tests / Kudu.Core.Test / HgRepositoryFacts.cs (all tests)
After a successful build that created all the artifact elements, you can proceed to deploy the Kudu website and web service code. Below are instructions for setting up a single instance of a web application, rather than dumping everything into c: \ inetpub \ wwwroot, as described in the instructions.
Copy the "artifacts \ Release \ KuduWeb" to the target area on the server on which your site will run. I run my kudu installation with a separate host header, but you can easily use a separate port or run as a root site. This directory will be the root of your web application.
Create an empty App_Data folder directly in the KuduWeb folder.
Copy the "artifacts \ Release \ SiteExtensions \ Kudu" to the same level as the folder in step 1, and rename it to "Kudu.Services.Web". This location is set as the relative path in the KuduWeb web.config file - serviceSitePath setting.
Open IIS Admin and create a website that points to the KuduWeb folder from step 1.
Configure the application pool from step 4 to run as "LocalSystem". This is required to manage IIS sites.
Create a new “apps” folder at the same level as KuduWeb. Deployments will be sent here. Note: this location is controlled in the KuduWeb website file web.config - setting "sitesPath"
Change the file system permissions to give the Users full access to the apps folder created in the previous step.
When I started my Kudu site, I received the following error.
Parser error message: Could not load file or assembly "System.Web.Mvc, Version = 5.1.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35" or one of its dependencies. The system cannot find the specified file.
For some reason, he did not copy the corresponding version of MVC to deployment artifacts.
If you push this error, the MVC 5 file can be obtained through NuGet. I found that my source code was created against 5.1.0, so this is the corresponding link:
https://www.nuget.org/packages/Microsoft.AspNet.Mvc/5.1.0
To extract the dll, I installed a new stub project and used NuGet to output the DLL through the package manager console.
Installation Package Microsoft.AspNet.Mvc -Version 5.1.0
Once you get the binary code, copy it from the package directory (. \ Packages \ Microsoft.AspNet.Mvc.5.1.0 \ lib \ net45 \ System.Web.Mvc.dll) to the bin directory of the site on the target machine.
At this point you are working. Use the web interface to create your application. It will create a subfolder in the "apps" directory with a tree, which should be clear. He also created two new websites for your application:
- kudu_ {your-app-name}
- kudu_service_ {-app your name}
In a production situation, you must create an additional website running on the appropriate port / host header, which points to:. \ Apps \\ site \ wwwroot
Now you can add remote git for deployment. Go to the original location in the git console (ex: git Bash) and add remote access as indicated by Kudu. Note: you may need to change localhost in the url to be the corresponding server name.
Git remote deployment add http: //: 52711 / your-app-name.git
Point your code to a new “deploy” remote access and see what happens. You should see all the usual push messages, as well as the output from the assembly.
Git push deployment wizard
My initial push failed to create and deploy due to a "node" that is not recognized. It was on the way, so the reset server convinced the path environment variable to update. You may find additional errors for the job. For example, I had a problem importing MSBuild and causing hiccups.
Error MSB4019: The imported project "C: \ Program Files (x86) \ MSBuild \ Microsoft \ Visual Studio \ v11.0 \ WebApplications \ Microsoft.WebApplication.targets" was not found.
YMMV, but now all these are solvable problems. Good continuous deployment!