Continuous Integration with Azure websites and TFS

So you’ve set up your new project and you’ve checked it into TFS, the next thing you’ll want to do is publish it to an Azure website!

It’s pretty simple to set this up, and here’s how:

 

2. At the bottom left of the screen, click the ‘+NEW’ button, choose Compute > Web Site > Custom Create

 

Set up a new Azure website

 

3. On the next screen that pops up, choose a name for your website, select the subscription you want it to belong to, and the region in which you want it hosting. Also you can attach it to a database from the dropdown menu on this screen. Finally tick the ‘Publish from source control’ and hit the next arrow

 

Create new website

 

4. On the next screen, choose your source control solution (I’m using TFS for this example, but you can use others)

 

Choose your source control

 

5. Next you will be asked to authorise the connection to your source control solution

 

Authorise your TFS connection

 

6. Once you’ve connected to TFS, you will be able to choose which repository to connect to

 

Choose your TFS repository

 

7. That’s it – you should now see your website being created, and it will appear in the Azure Management Portal under the Web Sites section

 

Your Azure website setup is complete!

 

Now all you need to do is check your code in to TFS, it will perform an automatic build and (as long as the build worked!) it will deploy your code to the website you just created. Navigate to your website, sit back, crack open a cold beer and be proud that you’ve just done something in a matter of minutes that can take other people hours to do!
Tagged with: , , ,