Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am developing a C#, MVC4, EF5 Code First application on .NET in Visual Studio 2012 and have used the VS publish mechanism to deploy it to an Azure Website with an Azure SQL Database.

I now want to use Git and GitHub for version control and involve others in the project.

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

I would like to use the Azure Website as the production server, another Azure Website as a Staging server, developer Windows machines using Visual Studio for development and GitHub as the central repository.

There is a helpful article here: http://www.windowsazure.com/en-us/develop/net/common-tasks/publishing-with-git/ . I can get my head around what would be needed here for, say, a PHP application on Azure. But I am unsure of the best approach with a compiled application and what I can achieve using Azure Websites and Visual Studio.

A nudge or two in the right direction would be greatly appreciated!

like image 829
harunahi Avatar asked Jan 14 '23 15:01

harunahi


1 Answers

don't publish from VS to azure, instead setup your azure website to pull from the github repo. 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

Also SocttGu announced this on his blog @ http://weblogs.asp.net/scottgu/archive/2012/09/17/announcing-great-improvements-to-windows-azure-web-sites.aspx he also talks about a cool feature of publishing branches, this will nail your requirement for a stage server and production server. Have a stage branch and a production branch and merge to them as desired. see the section "Support for multiple branches"

looks like they added support for private repos finally.

appharbor is a competitor to azure that does something similar.

like image 58
Chris DaMour Avatar answered Jan 23 '23 08:01

Chris DaMour