How to deploy a C #, MVC4 application on Azure using Git

I am developing a C #, MVC4, EF5 Code First application for .NET in Visual Studio 2012 and used the VS publishing mechanism to deploy it to an Azure site using an Azure SQL database.

Now I want to use Git and GitHub for version control and get others involved in the project.

However, although I am familiar with using Git in a LAMP environment, I have no experience using Git with Windows, Azure Websites, or a compiled environment.

I would like to use the Azure Website as a production server, another Azure website as an intermediate server, Windows machine developers using Visual Studio for development, and GitHub as the central repository.

There is a useful article here: http://www.windowsazure.com/en-us/develop/net/common-tasks/publishing-with-git/ . I can understand that here we need, say, a PHP application on Azure. But I'm not sure about the best approach to a compiled application and what I can achieve using Azure Websites and Visual Studio.

It would be helpful to appreciate a push or two in the right direction!

+4
source share
2 answers

Do not publish from VS to azure, but set up your azure website to pull github from the repository. The deployment process compiles your solution.

watch http://www.youtube.com/watch?v=5NGieL0tinw&feature=youtu.be&hd=1 or read http://vishaljoshi.blogspot.com/2012/09/continuous-deployment-from-github-to.html

SocttGu also announced this on her blog @ http://weblogs.asp.net/scottgu/archive/2012/09/17/announcing-great-improvements-to-windows-azure-web-sites.aspx , he also says About the cool feature of publishing branches, this will require your requirement for a server stage and production server. Have a branch at the stage and a production branch and go to them at will. see "Support for multiple branches"

it looks like they finally added support for private repositories.

appharbor is a competitor to azure that does something similar.

+8
source

Basically, you introduce a new step requiring that the source code be compiled before it is deployed to the server. Where you perform this step is up to you. You could:

  • Make sure your target server has the ability to compile the source code (some continuous integration tools may help, for example, CruiseControl.NET). This has a caution that the target server will be able to compile the source code (possibly even requiring the installation of Visual Studio), so this may not be an option.
  • Check the compiled binaries in the source control. You can save these compiled binaries separately from the main source to maintain cleanliness. Deploy the binaries to the target server.
  • A hybrid of the previous two options is also possible; you can configure a continuous integration server with CruiseControl.NET, which can check the current source, compile it and check the resulting binary file back into a special branch, and then deploy this branch to the target server.
+1
source

All Articles