Announcing Continuous Deployment to Azure with Team Foundation Service
I mentioned earlier this week in my sprint 31 deployment post that we were working on some bigger things I wasn’t ready to talk about yet. Well, this is one of them….
As development organizations are trying to improve the cycle times on their development process – getting ideas through development and into production and collecting feedback faster and faster, they are looking for ways to streamline the process. You hear a lot of talk these days about “DevOps” and “NoOps”. Both are rapidly evolving perspectives on how to improve the interaction between development and production with the goal of improving the cycle time and the application quality. One of the evolving practices in this space is “Continuous Deployment” – getting new versions of the app into production (or a production like environment) continuously to exercise the muscle and see the results.
Today, we unveiled a partnership between Azure and our Team Foundation Service that enables automated deployment of either Windows Azure Websites or Windows Azure Cloud Services. By default, we configure automated deployments with every checkin but you can modify that to do scheduled or manual deployments – basically anything you can do with a TFS Build.
Getting started is really easy. The below is not intended to be a full fidelity tutorial, but rather an overview of what you can expect the experience to be like. For a step by step tutorial check out: http://www.windowsazure.com/en-us/develop/net/common-tasks/publishing-with-tfs/
**Important** – To enable the new continuous deployment features we created a new build process template called AzureContinuousDeployment.11.xaml. This process template lives in source control at $/<teamprojectname>/BuildProcessTemplates folder. If you create a new Team Project, it will automatically be added for you. Existing projects won’t have that process template and we were a little loathe to go and insert it into everyone’s existing source control. As such, you will need to add it yourself if you want to configure continuous deployment. If you try to connect your azure account to your existing projects your will get the following error.
Failed to link TFS project ‘MS’ with your web site ‘<websitename>’
TF42073: The value cannot be null (Parameter name: Process)
I’ve attached the xaml file you will need to this blog post. You can map the BuildProcessTemplates folder into a workspace on your machine, download the xaml file from this post and then drag it into Source Control Explorer or copy it to the folder and add it either from the command line or the GUI, etc. Once that is done you can use the wizard to setup a continuous deployment build definition.
**Update** – There’s an additional step. In addition to checking in the new build process template, you need to create a build definition that is configured to use it. You can read the comments below by Thomas Quinn on the detailed steps for doing that.
In this walk-through I’m going to show doing an Azure Website.
You start with an Azure account. If you have one already, you’re good to go. If not, you can go to http://www.windowsazure.com/ to signup – either with a free trial or a full account (both will work with the new continuous deployment capabilities). Once you have your Azure account, create a website and go to the website dashboard on the Azure portal. On the bottom right, you’ll find a link to “Setup TFS publishing”. Click that and it will launch a wizard to connect your TFS project to the Azure application.
The wizard will allow you to connect to an existing Team Foundation Service account or create a new one. Either way, once you have the account, enter it in the “user name” field and click “Authorize Now”. That will take you through a little authorization wizard. Then it will take you to a page to choose the Team Project that the source for your app is in.
At this point, your Azure and Team Foundation Service accounts are linked. As part of linking the accounts, we also created a continuous integration build definition that will build and deploy your app to Azure each time you check in. So the next thing you might want to do is go to Visual Studio and check in a new web site or a change to an existing one and watch it deploy. If you are using the VS 2012 Release Candidate that we announced last week, you can just click the Visual Studio icon at the bottom of the Azure page and that will open Visual Studio, connected to the project you’ve configured. If not, you can just go run VS 2010 and connect to your Team Foundation Service account.
You can see the deployment results either by looking at the TFS build report or by looking in the Azure Portal…
You can also see deployment results from inside the Team Foundation Service web UI…
There’s really only a little bit of “magic” here. Clearly we’ve done some OAuth work to enable TFS and Azure to collaborate. For now, that OAuth work is private but we expect to open it up in the future for more service to service integrations. We’ve also added a new concept of a “deployment environment” that contains the necessary information to connect to a deployment endpoint, securely storing credentials, etc. Beyond that, all of this integration really comes down to a new set of TFS Build workflow tasks that are able to perform Windows Azure deployments. We also added a little bit of new UI in the build explorer in Web Access to show and manage deployment status.
It’s natural to ask if you can do this with your on premises TFS server. Of, course you can do automated deployment to local environments using Lab Management. There are also manual ways to configure an on premises TFS Build to deploy to Azure. As you can see from the article, there are a lot of steps. As our new Azure continuous deployment feature matures, we expect to bring more of the capability and simplicity into our on-premises TFS product as well. We think of what’s out there now as a “preview” like the rest of the Team Foundation Service currently is.
If you are doing any Azure development, I hope you will find that this is a really awesome way to streamline your development process. Give it a try and please share any feedback you have. You can use our forums at: http://social.msdn.microsoft.com/Forums/en-US/category/windowsazureplatformctp
I look forward to hearing from you…