Thursday, 16 October 2014

Deploying to Microsoft Azure Web Site from GIT

Microsoft Azure supports direct deployment from GIT. That is very much helpful if we have to publish our codes on a regular basis or multiple times a day.

 Following are the steps to set up the Azure deployment from source control - 
 
 1. Here I will assume you are already having a local GIT repository, if not, then get GIT and create one repository and put your source code in that.

 2. Login to Azure Portal.
 
 3. Select the web site for which you want to activate deployment.
 
 4. Goto DASHBOARD Tab.
 
 5. On quick glance section ( right side of the page ) select Set up deployment from source control - this will open up SET UP DEPLOYMENT dialog.
 
 6. Create your user name and password.
 
 7. Copy generated GIT URL.
 
 8. Open Git Bash.
 
 9. Change directory to GIT repository root.
 
 10. Run command - git remote add azure generatedGITUrl. So, for example, if the generated GIT Url ( from point #7 ) is say "xxx@yyy.scm.azurewebsites.net:445/therepository.git", then the command will be as follows - 
git remote add azure xxx@yyy.scm.azurewebsites.net:445/therepository.git
 
 11. For deploying local GIT repository content, run command -  git push azure master
 
 And that is all, every time you want a deploy, you just need to run the command of Point #11, and you are done. Easy and simple steps to make our life easy and in a better way.

No comments:

Post a Comment