Sunday 6 December 2015

Things to remember when you work with Azure and the new Team Build

Azure is an amazing piece of technology – its capabilities are immense and there is always something new to learn and use for solving our problems.

It is quite a while I am spending time on it, together with the new Team Build and a few other bits and pieces all around. I thought about summarising these little issues you might face as well, so you should save some time Smile

First of all, please remember this: if you don’t have a build task OOB, and you don’t want to write your own, you can still use PowerShell! Never forget how powerful it is, because it can be used in literally thousands of ways.

If you are working with TFS 2015 RTM you won’t have the new build tasks bundled with the Update 1 or support for Service Principals, but don’t worry – you can achieve the same results with a bit of PowerShell.

For example, bearing in mind that creating a Service Principal for your Azure Active Directory is as easy as the first part (steps 1, 2 and 3) of this blog post, this is all you need to do in a PowerShell script to use the Service Principal for authentication:


At the moment support for Service Principals is limited to Azure Resource Manager, so for deploying any components you might want you still need to rely on the old certificate-based authentication.

The issue here is that the combobox in the build task for Web App Deployment (VSTS or TFS 2015.1) doesn’t specify anything like that. What I suggest is to follow the following approach and add the Azure subscription with both authentications:


So you would get a subscription in the comboboxes anyway, regardless of the authentication method you chose.

Eventually, bear in mind that the new build agents expose capabilities – so if you want a specific agent with Azure PowerShell installed you would need to specify AzurePS as a demand in the build definition.

No comments:

Post a Comment