Deploying an Azure Website from a local Git Repo

Azure offers you the ability to host a website under your Azure account in minutes.  The site doesn’t have to be ASP.NET, you can use HTML5/JavaScript, a static HTML page, PHP, Python, Classic ASP and others.  This is a great way to get your site hosted, especially if you already have an Azure account and you don’t need access to other Azure offerings such as Web Role, Worker Role, Table/Blob Storage, and more.

Just like any other web hosts out there, you are able to FTP your files using your favorite FTP client.  But Azure offers you other options which make our life a lot easier, one of them is by configuring your Azure hosted directory as a Git repository.  This allows you to push files to it from any other Git repo such as Visual Studio Online, TFS 2013, GitHub, and even a local repo.  This is how you configure your deployments from your local Git repo using Visual Studio 2013:

Create an Azure Website and Configure Git Deployment

Go to your Azure Portal, then click on the Websites, then click on New and select “Custom Create”.  This will allow you to configure a database (if any) and specify your deployment source.


Enter your URL, Region, Database, and check the “Publish from Source Control” checkbox:

Then select Local Git Repository as your source:

As of this moment, the list of sources is: Visual Studio Online, Local Git repository, GitHub, Dropbox, Bitbucket, CodePlex, or any externally accessible Git or Mercurial repository.

Click on next, and the site is created.  Back from the Azure portal, you can click on your newly-created site, and select “Deployments”.  Here you can see instructions on what you need to do to get your site deployed:

Before you can deploy, you’ll need to create credentials that will be used by Git:

Now time to create a website and deploy to Azure.

Create your new Website locally

From Visual Studio 2013, create a new website: File –> New –> Website. I selected an ASP.NET Empty Website, with a very simple default.html page:

Create a local repo and commit your files

Right-click on your solution and select “Add to Source Control” and select Git

Then Right-click on your solution and select Commit, which will bring up the Commit tab in Team Explorer:

Configure the remote repo

Once your files a committed to your local Git repository, you can use the information provided by Azure to configure the remote repository.  Clicking on the Unsynced Commits link shows you that your remote repository is not configured yet:


So in my case, I will enter this URL in the remote repo textbox:, then click on Publish.  You will be prompted for your credentials that you configured earlier.  And a few short seconds later, you will get a message letting you know that it was all successful:


And here is awesome new site!

Now every time I push to my remote repo, my site will get automatically deployed!

Interested in learning more about Git?  Check out my new Pluralsight course on Git for Visual Studio Developers!

About esteban

Esteban is the Founder and Chief Technologist at Nebbia Technology, an ALM consulting and Azure-powered technology company. He is a software developer with a passion for ALM, TFS, Azure, and software development best practices. Esteban is a Microsoft Visual Studio ALM MVP and ALM Ranger, Pluralsight author, and the president of ONETUG (Orlando .NET User Group).

7 thoughts on “Join me at VSLive in Orlando!

  1. Emre

    Is there any way to remove old folders from azure? When I delete a folder from my local and deploy project, it is not removing from Azure.

  2. Microsoft DevOps Blog

    […] Join me at VSLive in Orlando! – Esteban GarciaThis November, I will be back at Live! 360 in Orlando.  The conference runs from November 12th through November 17th at the Royal Pacific Resort. […]

  3. Professional PC Services

    I like your post! I read your blog often and I shared this
    post on my Facebook and my friends loved it. Keep up the awesome work.

  4. Pedenti Prasad

    import-digital-certificate-in-etoken-no key corrponding to this certificate was no found

  5. Pedenti Prasad

    Import Digital Certificate In eToken User certificate No Key Corresponding to This certificate Was Found.

    1. Pedenti Prasad

      Import Digital Certificate In eToken User certificate No Key Corresponding to This certificate Was Found.

  6. Andrew German

    From my point of view, dynamic scaling should be checked in advance to make sure everything is fine. The cloud infrastructure support provider should be used to compare between apples. If the test environment is different from the working one, data integrity raises serious questions.
    Here’s an indicative solution

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? *