Continuous Learning and Sharing of Team Foundation Server and Application Lifecycle Management RSS 2.0
# Sunday, April 06, 2014

In Team Foundation Server 2012, Microsoft introduced a tool for helping teams forecast how many iterations a project will take and show which stories will fall into each of those iterations.  It also provides a simple way adjust the target velocity to try multiple values.  Use this along with the drag and drop ordering of the backlog and you can also see how the priority will affect the forecast. There are a few things to understand with the tool to make sure you get the most out of it. In this post I’ll explain why to use the forecasting tool and explain 5 tips so you don’t try to use the tool for beyond the intention.

So why use the forecasting tool? I can assign all of the stories to each Iteration.  Depending on how many stories this will be quite a task.  Also, especially at the beginning of the project, the velocity, or number of stories to be completed each iteration, will be difficult to predict.  If you estimate your team will have a target velocity of 30 and then decide you think it might be 36, you would need to move the stories for each iteration.  Furthermore, the backlog is going to change when new stories and changes to existing stories are made that will cause a lot of rework.  This is where forecasting is extremely helpful.  This is a lightweight tool that was originally released in TFS 2012 web access agile planning tools and has been updated slightly in TFS 2013. 

To use the forecasting tool, select the stories backlog for any team in your team project (#1).  Then turn the Forecast tool on (#2).  The backlog will immediately show how many user stories will fall into each iteration.  Adjust the target velocity (#3) to see how it affects the iterations.  Follow the 5 tips below to get most out of the feature and understand the way it works.

image

Tip #1 - If the iteration has started, it doesn't show in the backlog but stories do.

One of the first things that you might notice is that your current iteration doesn’t show in the iteration forecast.  This might cause some confusion looking at the backlog on the first day of an iteration. You must pull the stories into the iteration and commit to them the forecast before it shows correctly.  However, committing to the stories still might not look like what you would expect.  See Tip #2.

Tip #2 - Stories that are not closed still show in the backlog but if they are active, the points no longer count as part of the forecast.

As I described above, I have pulled the user stories into Iteration 1 and moved the state to Active.  The user stories will show in the list until they are closed but the points do not count in the forecast.  If you used the tool in TFS 2012, you probably noticed this behaves differently.  In TFS 2012, once you moved the story to Active, the story wouldn’t show on the list anymore.

image

Tip #3 - Left over points roll over to the next iteration can be used by the next iteration.

This one caught me off guard and I would say is the most controversial feature.  If the forecasted iteration is less than target velocity because the next item would put it over, the tool will use those points for the next iteration.  This assumes you would always pull in stories once the others are completed to consistently get the same velocity completed even though you wouldn’t credit until those stories are completed in the following iteration. 

Tip #4 – A story with story points larger than the target velocity excludes the iteration because nothing will be complete that iteration.

If you are small team or using large story points, you might see Iterations that are missing in the forecast because the story points are too large and technically nothing will be completed that iteration.  Notice how Iteration 4 is missing because there is a 13 point story when then the target velocity is 10.

image

Tip #5 – Forecasting is just that.  Don’t try to use it for full blown scheduling tool.

As you have seen there are a few behaviors with forecasting that might keep you from wanting to use it for the release schedule. If you use fall through or hardening iterations, you can’t assign zero or a limited velocity for those iterations to allow for fall through stories or unidentified technical debt stories.  Understand the intention and the limitations and it will be useful for forecasting your future iterations. This is intended to show how long and what will be completed in each iteration when the effort completed each iteration matches the target velocity.

Sunday, April 06, 2014 6:40:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
Agile | ALM | Team Foundation Server

# Thursday, March 20, 2014

The 4th Annual Nebraska Code Camp is a little over a week away and Deliveron is proud to support it again this year.  This community-driven developer conference hosts 200+ attendees each year and is free to attend on Saturday. NECC draws great speakers from around the country and this year even internationally with the keynote speaker, Iris Classon.  There is still time to register.

Deliveron has been a sponsor of NECC for the past 3 years and has spoken at it every year.  We will have our booth there again this year so stop by to learn more about Deliveron, job opportunities, any help you need with projects, or just to say hi!  The schedule is packed with informative sessions for all levels from middle/high school to advanced.  Also come attend talks by two of Deliveron’s consultants, Andy Bayer and Mike Douglas. 

Andy Bayer will talk to us about Maintainable Unit Tests - that's an oxymoron right? (Saturday 3:15).  Here is what to expect:

Given the fact that everyone is writing unit tests for their code (that's a fact right?), that must mean we are all totally happy with the amount of maintenance unit tests can be. I personally really enjoy making a one line code change and have to fix 100+ unit tests before my solution will even build - makes my day every time. Now back to reality - there are a few simple patterns that you can implement to shield your unit tests from being impacted by code changes, yet still make them flexible enough to test what you need to test. I'll be using moq for my samples, but the patterns will work with whatever mocking framework you prefer.

Mike Douglas is giving two workshops on Friday and one talk on Saturday.

Developer Productivity ALM Delivery (Friday 8:00 to 12:00)

Visual Studio is packed with so many features and tools, how do you learn about them and know which ones to use? Once you do decide you want to use a tool, how do you provide guidance so that everyone uses it consistently? Are there ways to track and measure that developers are following the process and be able to correlate this to the overall health of the application and project?

In this workshop attendees will learn to use Visual Studio tools and features for each step of the process from design to delivery with hands on labs using the features in Visual Studio. I'll walk you through the Developer Productivity ALM Delivery guidance documentation we have created for internal projects and for help our clients. In addition we will discuss how to track the process and provide a quality review process where all developers can understand how they are doing for each Iteration.

 

Agile Planning from Teams to Enterprise with Team Foundation Server 2013 (Friday 1:00 to 5:00)

 

Sticky notes keep falling of your task board? Wondering how you can quickly shift work between teams? Team Foundation Server 2013 introduces a number of improvements including backlog management, task boards, agile portfolio management, Kanban, and various reporting improvements.

In this workshop attendees will learn how to capture user stories, manage multiple team backlogs, view the teams progress rolled up to department or enterprise level. Attendees will also learn about the Kanban tools and other improvements to help support planning through a simple to use web interface for the entire team. There will be a series of hands on labs for using these features in TFS 2013 Web Access, with access we will provide through the Internet. We will finish with a look at what is coming in the TFS 2013 Update 2 release including improvements for work item tagging, Kanban, and web charting.

 

Developer Productivity Improvements in Visual Studio 2013 (Saturday 4:30)

 

With every new version of Visual Studio, Microsoft introduces a number of features designed to allow you do more in less time while improving the quality. In this talk I will go through a number of these features that help improve developer quality and productivity, and help understand code. Features include Visual Studio IDE improvements, using Code Lens and Code Map to understand the code quickly. Also, I will go through tools that can help track and measure the quality of your application over time. Last, I will wrap up by going through recent productivity improvements for suspend/resume, code reviews, and Team Rooms.

We hope to see you there!

Thursday, March 20, 2014 5:21:00 PM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
ALM | Deliveron | Nebraska Code Camp | Visual Studio

# Friday, March 14, 2014

Thanks to a lot of great feedback, I have released some minor updates to TFS Agile Poker.  Changes include:

  • Upgraded to support Windows 8.1
  • Made backlog items columns resizable and increased the number of items to 50 per page
  • Added Copy Invite to clipboard feature so you don’t have to set up the mail store app
  • Fixed connection refresh issue if connection information is changed on the getting started page
  • Changed TF Service to Visual Studio Online

I have more features to implement. Look for some more updates in the coming soon.

www.tfsagilepoker.com

image

image

Friday, March 14, 2014 7:42:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
TFS Agile Poker | Windows 8.1

# Saturday, September 28, 2013

My main developer PC (Windows 8) had been running slow lately so I decided to wipe the drive and perform a clean installation of Windows 8.1.  I have been running the Windows 8.1 preview on my Surface Pro for the past couple months and I love the improvements.  Most of the improvements are subtle but make using Windows much more user friendly.  This time I’m going to try to be more selective in what I install on it and use Virtual Machines for most of the development so I don’t slow down my host.  So far the laptop has been incredibly fast.  I decided to install Visual Studio 2012 (and installed Update 3) on my host because there are a lot of times I need to access TFS or create a sample project and I don’t necessarily want to have to start one of my VMs.  When I tried to create an ASP.NET MVC 4 application I was prompted with these two error messages.  I was able to get both resolved but I thought I would post this in case anyone else runs into this.

The first dialog prompted me that

Configuring Web http://localhost:8547/ for ASP.NET 4.5 failed. You must manually configure the site for ASP.NET 4.5 in order for the site to run correctly.  ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.0 in order for your site to run correctly.

image

Most of the posts suggested deleting the IISExpress folder under documents because it recreates it the next time an application is run.

image

I deleted the folder, reran Visual Studio but I still received the same error.  I repaired .NET Framework 4.5 as shown below and it fixed that message.

image

When I tried to open the solution after I fixed the first error, the following dialog still displayed. 

ASP.NET 4.5 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.5 in order for your site to run correctly.

image

I had received similar messages in the past working with previous frameworks.  My first thought was to go to a command prompt and register .NET 4.5 with IIS.  I ran aspnet_regiis and received the following message.  It look like now in Windows 8/8.1, this is a Windows Features option.

This option is not supported on this version of the operating system.  Administrators should instead install/uninstall ASP.NET 4.5 with IIS8 using the “Turn Windows Features On/Off” dialog, the Server Manager management too, or the dism.exe command line tool.

image

Using the handy Windows-X key combination I selected the Programs and Features dialog.  I chose Turn Windows features on or off and the dialog appeared.  I expanded the .NET Framework 4.5 Advanced Services and selected ASP.NET 4.5.  Everything worked after that!

image

Note:  This is also required on Windows 8 but I didn’t have to do this manually when I installed Visual Studio 2012 on Windows 8.  I’m also not sure if installing Visual Studio 2013 will automatically select this.

-Mike

Saturday, September 28, 2013 6:12:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
ASP.NET | Visual Studio 2012 | Windows 8.1

# Tuesday, August 13, 2013

ADFS, or Active Directory Federated Services, is Microsoft’s implementation for claims based authorization and authentication with Windows Domains. This allows companies to share or federate their security with other organizations that they trust.  This is already prevalent across the web in how you can use your Facebook, Google, or Microsoft account to login to other websites because those credentials have been issued by a trusted identity provider.

When using an ADFS enabled website (called Passive authentication), the first time you access the site, it will automatically redirect to the identity provider.  AFDS in this instance creates the user authenticated token and redirects the user back to the website with a cookie that you have been successfully authenticated.  Subsequent calls will use the token to prove you have already been authenticated and not require the redirect to ADFS until the token is not longer valid.

The web performance tests and load tests will also need to follow the same path and authenticate to ADFS on the first call and not on subsequent calls.  When you create a Web Performance Test it will succeed against ADFS because it records the ADFS authentication steps, however when you try to run it multiple times in a load test, it will fail because it no longer follows the same path because the token is already present.  There are probably several ways to accomplish this but there isn’t a lot on the web for this.  This solution to making the load tests work is to turn the Web Performance Test into a Coded Web Performance Test and then create a condition to check for the FedAuth cookie to decide whether or not to the user is authenticated.  Here are the steps for accomplishing this.

1. Capture Test

When you create a new Web Performance Test, a web browser widow is opened with the recorder already recording.  Paste the URL into the browser, display the page and any subsequent requests, and then stop the recording.  This will create the set of HTTP calls.  Run the test to verify that it passes.

2. Create the Coded Web Performance Test

Click on the Generate Code button and give it a name.  I usually accept the default name.  I also organize the Coded tests and regular ones into separate folders for better organization.

image

Next run the test to still make sure it works.  In Visual Studio 2012, right click within the test and choose “Run Coded Web Performance Test” from the context menu.  These tests will not run from the “Run Tests” option like Coded UI Tests or Unit tests.

clip_image001

3. Create the Load Test                 

Create a basic Load Test with the following settings:

  • Load Pattern: Constant Load w/ 1 user
  • Test Mix: Add the Coded test from step 2.
  • Run Settings: Change to Test iterations and set the value to 2 iterations.

Run the test and you will see one success and one failure.  You should see something like the following two errors:

  • https://myserver.mydomain.com/Customers/Order/Edit/11111              Validation Rule Error       ValidateResponseUrl     The value of the ExpectedResponseUrl property 'https://ststest.mydomain.com/adfs/ls/auth/integrated/' does not equal the actual response URL 'https://myserver.mydomain.com/Customers/Order/Edit/11111'.  QueryString parameters were ignored.               -              Test log               
  • Context parameter '$HIDDEN1.wa' not found in test context                     

Both of these are due to the fact that it is expecting to be redirected to the ADFS server but wasn’t because it was already authenticated.

 

5. Create Conditional Rule for the FedAuth cookie

To fix this, we need to create a conditional rule to check for to see if the FedAuth cookie is already present and not redirect to the ADFS server.  Create the Conditional Rule before the request1 statement and add a BeginCondition call before it.

CookieExistenceRule conditionalRule1 = new CookieExistenceRule();
conditionalRule1.Webpage = "https://myserver.mydomain.com/Customers/Order/Edit/11111";
conditionalRule1.CookieName = "FedAuth";
conditionalRule1.CheckForExistence = true;
conditionalRule1.CookieDomainName = "";
conditionalRule1.CookiePath = "";

this.BeginCondition(conditionalRule1);

WebTestRequest request1 = new WebTestRequest("https://myserver.mydomain.com/Customers/Order/Edit/11111");

6.  Add Execute Conditional Rule before the the expected result for request1

This can vary slightly based on your test.  As you will see in this example, there are two places to add the ExecuteConditionRule but I had other tests where there was just one location.   I also ran into instances where I needed to add an else and had to set the ExpectedResponseUrl to the correct page and not the ADFS server.  This may require some trial and error before getting it correct.

if (!this.ExecuteConditionalRule(conditionalRule1))

{

                request1.ExpectedResponseUrl = "https://ststest.mydomain.com/adfs/ls/auth/integrated/?wa=wsignin1.0&wtrealm=http" +

                "s%3a%2f%2fmyserver.mydomain.com%2f&wctx=rm%3d0%26id%3dpassive%26ru%3d%252fCustomers" +

                "s%252fOrder%252fEdit%252f11111&wct=2013-08-06T16%3a11%3a06Z";

                ExtractHiddenFields extractionRule1 = new ExtractHiddenFields();

                extractionRule1.Required = true;

                extractionRule1.HtmlDecode = true;

                extractionRule1.ContextParameterName = "1";

                request1.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule1.Extract);

}

yield return request1;

request1 = null;

 

7. Add Execute Conditional Rule to any other calls where the ADFS Server is the referer.

Not all tests will have this.  In this case request4 has a referer header from the ADFS server.  Add the conditional rule to after the request statement.  Include an else statement and set the ExpectedReponseUrl to the “default” URL when you access the site. 

WebTestRequest request4 = new WebTestRequest("https://myserver.mydomain.com/");

if (!this.ExecuteConditionalRule(conditionalRule1))

{

                request4.Method = "POST";

                request4.ExpectedResponseUrl = "https://myserver.mydomain.com/Customers/Order/Edit/11111";

                request4.Headers.Add(new WebTestRequestHeader("Referer", "https://ststest.mydomain.com/adfs/ls/auth/integrated/?wa=wsignin1.0&wtrealm=http" +

                "s%3a%2f%2fmyserver.mydomain.com%2f&wctx=rm%3d0%26id%3dpassive%26ru%3d%252fCustomer" +

                "s%252fOrder%252fEdit%252f11111&wct=2013-08-06T16%3a11%3a06Z"));

                FormPostHttpBody request4Body = new FormPostHttpBody();

                request4Body.FormPostParameters.Add("wa", this.Context["$HIDDEN1.wa"].ToString());

                request4Body.FormPostParameters.Add("wresult", this.Context["$HIDDEN1.wresult"].ToString());

                request4Body.FormPostParameters.Add("wctx", this.Context["$HIDDEN1.wctx"].ToString());

                request4.Body = request4Body;

}

else

{

                request4.ExpectedResponseUrl = "https://myserver.mydomain.com/leaders";

}

this.EndCondition(conditionalRule1);

Add the EndCondition statement after the last closing bracket of the the last conditional rule. Ensure this is only called once and it is after the last conditional rule or the test will fail.

 

 

8. Rerun the Coded Web Performance Test

Repeat step 2 and rerun the Coded Web Performance Test.  Verify that the test is passing. 

9. Rerun the Load Test

Rerun the Load Test that you created in step 3.  Both iterations should pass now.  You can add more instances and/or users to test the system under load.

Additional Items

1. If you notice any calls to https://urs.microsoft.com/urs.asmx, this is caused by the smartscreen filter being turned on in IE.  I would recommend removing these calls and disabling it in IE.  This was being called multiple times within a test and taking 40+ seconds to the test.

2. If you test contains a number of AJAX calls consider turning off the think times.  This can be done and the scenario step of the wizard or in the properties under scenario. 

Tuesday, August 13, 2013 6:42:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
ADFS | Load Testing | Visual Studio 2012

# Sunday, August 04, 2013

Who says the sequel can’t be as good as the original?  Packed with new features and UX improvements, Version 2 of the ALM Readiness Treasure Map has been released and is available for download in the Windows 8 Store App.  For those of you that are not familiar with the first version, the ALM Readiness Treasure Map is a one stop shop for all of the ALM Ranger content organized so you can quickly find the needed guidance and tooling.  Even as an ALM Ranger, I have found it a challenge keeping track of the all the releases.  This tool makes it really easy to find, read, and track all of the releases.

Some of the improvements in v2 include:

  • Progress Tracking
  • Up-to-date News
  • Updated Ranger Releases
  • Favorites
  • Many UX improvements

image

One thing I really like is to put the application in snapped mode so you can view the content side-by-side in IE.

Download it today from the Windows 8 Store and let us know what you think through the ratings and comments.

Take a look at the MSDN article from earlier in the year on V1 and Willy’s Reflections for more info.  We have already started on 2.1 so look forward to even more improvements in the future.  I had the opportunity to help out towards the end with some development and testing.  I’m looking forward to continuing helping the next versions.

Mike

Sunday, August 04, 2013 8:04:00 PM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
ALM | Rangers | Windows 8

# Sunday, July 21, 2013

I just got a Surface Pro and the first thing I did was to upgrade it to the Windows 8.1 Preview.  There are a lot of new features in Windows 8.1 Preview that I like and it seems fairly stable.  After I loaded Windows 8.1 Preview I wanted to install Visual Studio 2012 and Visual Studio 2013 Preview.  I first tried to install Visual Studio 2012 using the web installer.  When I ran the installer I received this error.

Windows Program Compatibility mode is on.  Turn it off and then try Setup again.

imagex`

After doing some searching, I didn’t find any information that helped.  The last thing I tried was downloading the ISO and doing the installation from there.  Windows 8 and 8.1 Preview can automatically mount ISO images as another drive, so installing from the ISO would be easy.  When I launched the setup, it ran fine and installed Visual Studio 2012 successfully.  Be sure to download and install the latest update (as of this writing, Update 3 is the latest update for VS 2012.).

 

image

I hope this helps someone.

BTW – I blogged this from my Surface Pro running Windows 8.1 Preview and it worked great!

Mike

Sunday, July 21, 2013 4:12:00 PM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
Visual Studio 2012 | Windows 8.1

# Sunday, May 05, 2013

Overview

The ALM Rangers heavily leverage the power of Team Foundation Service (TFService) for all of our projects.  While TFSService doesn’t contain all of the features found in on-premises Team Foundation Server, for most projects and applications that we build, the features available within TFService are sufficient.  For this project we are working on the V2 of the ALM Readiness Treasure Map, a Windows 8 Store App.  If you are not familiar with V1, read the article, A Treasure Hunt Through ALM Readiness, in the MSDN magazine and download the app from the Windows 8 Store.  With this project, there are two features that we can’t accomplish with TFSService.  TFService does not include symbol server support.  In addition Windows 8 Store apps cannot be built with Team Foundation Service.  If we were to use an on-premises build server with Team Foundation Service, we could support building the application.  Read the Building and Validating Windows Store Apps with Team Foundation Service article in the April 2013 edition of MSDN Magazine for a great walkthrough on creating an on-premises build server for TFService to build Windows 8 Store apps.

Since we are using a pure TFService solution, we will need to store the symbols, binaries, and the app package in source control for released and internal builds. Below is the solution enabling and using the debug symbols and also storing binaries and packages for release and internal builds.  This is our initial plan and it may evolve as the project progresses.  In addition, hopefully in the future TFService will support both of these features. Be heard and vote for Windows 8 Build Support and Symbol Support on Visual Studio User Voice. As always, we always appreciate your feedback and your ideas for this solution.

Enabling and Using Debug Symbols

Enable full debug symbol information for the release build configuration in addition to the debug build configuration.  This will allow us to have detailed stack information about the error that include line numbers of the errors and debug the application without the source control.

image

Also ensure that the include public symbols, if any, to enable crash analysis for the app option is checked when creating the app package.

image

To be able to use the debug symbols within the application, perform the following steps.  The TreasureMap application’s namespace begins with Microsoft, so you need to remove the Microsoft.* exclusion from the options.

image

Once the symbols have been included, if you wish to debug the issue from production, use Visual Studio to debug the application by choosing Debug Installed App Package… option.

image

Choose the installed app package to debug

image

From within Visual Studio, you will be able to hit exceptions and step through the application’s code.

image

Storing Release Builds

When a release candidate version has been accepted by the Windows app store, take the output from the packaging and binaries and put it into the following folder structure.  Then check-in all of the files into source control as shown below:

Rel\[version]\Binaries


image

Rel\[version]\PackagedOutput

 

image

Storing Internal Builds

Internal Only releases should be built locally and stored in the Drop folder in TFService.  Use the following folder structure and naming convention.  Under varTreasureMap_Dev, create a new folder using the format [Date].[Build Number]. In this folder, copy and check in the binaries / output from the build into the Binaries folder.  Also create the app package files locally by choosing Project > Store > Create App Packages.  Be sure to choose No when asked if you want to publish to the Windows Store.  After going through the wizard, copy the output to the PackagedOutput folder under the build folder and check in these files.  Send an email to the team letting them know a new internal version is available for side loading to test.

image

Sunday, May 05, 2013 8:01:00 PM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
ALM | Rangers | Team Foundation Service | Visual Studio 2012 | Windows 8

# Thursday, April 18, 2013

Continuous Delivery is the process of automatically building, testing, and deploying the application through test and into production at regular intervals.  Windows Azure is Microsoft’s cloud based application hosting platform that provides Infrastructure and Platform as a service solutions for for building, deploying, and managing solutions that can scale to support millions of uses with only configuration changes.  In addition Window Azure can extend your or replace your network infrastructure.  Microsoft also offers a full featured Application Lifecycle Management tool in Azure called Team Foundation Service. 

Setting up Continuous Delivery with Windows Azure and Team Foundation Service is as easy as creating the accounts, linking the two systems together, and checking in your code.  The following post provides a step by step walkthrough of setting up the process.  I have also created build and deploy process for Azure Cloud Service applications for on-premises Team Foundation Servers.  Unlike the out of the box (OOB) solution for Team Foundation Service, setting up the solution for on-premises TFS requires customization and installing additional components.  I will write on this in a future post.

Are you on Team Foundation Service?

The first thing to do is sign up on TFService if you haven’t already do it.  Pricing hasn’t been announced yet but it has been announced that there will be a free tier and a tier included with MSDN.  In addition, right now, while it is still in preview it is free. So, there isn’t any reason to keep from trying it.  Sign up at http://tfs.visualstudio.com.

Sign up for Windows Azure

Signing up for Windows Azure is easy.  You can start using a lot of features for free by signing up through your MSDN account or for a free trial

Continuous Delivery Setup

Now that you have both of your accounts, let’s create the Cloud Service to host your application.  When you open the Windows Azure management screen, you will see a list of all available features including the cloud services as shown in figure 1. 

Windows Azure Management

To create the cloud service, choose the Create (+) option in the bottom left corner, the new dialog window will display.  If you are currently in the cloud services area, the following options will automatically populate otherwise choose these options and enter the URL for your site and the preferred region.  It will validate that this name is available with a green checkmark.

Create Azure Cloud Service
Figure 2 – New Cloud Service dialog in Windows Azure

 

Once it has been created, the dashboard will display with the following steps.  Here you can create the deployment settings for your build.  In our instance, we will create our TFS connection and let it create a default staging deployment.  If you want more control over the deployment you will want to create the deployment settings first.  Choose Set up TFS publishing to begin the authorization process to link the two systems.

Cloud Service has been created

The Authorize TFS connection dialog will appear where you enter your Team Foundation Service account/collection name.  Select Authorize Now to connect to your TFService account.

Authorize TFS connection

It will prompt you with the request to grant Windows Azure access to your TFService account.  Choose Accept.

Cloud Service requestiong permission to Team Foundation Service

Next, choose the Team Project that will contain your Cloud Service application.

Choose TFS Team Project

Once the linking process has completed, it will guide you through the next steps.  If you haven’t already downloaded the Azure SDK tools, you should do this.  If you are unsure if you have these tools installed, when you try to create the solution with Visual Studio in the following step, it will prompt you to download the tools.  Click On Open Visual Studio 2012 to open the IDE with the Team Project opened that you selected above.  Note: This does not open Visual Studio 2012 automatically with elevated permissions.  If you wish to run your solution locally with the cloud emulator, you must run Visual Studio under elevated permissions.

Cloud Service and TFS are configured

Within Visual Studio 2012, choose New > Project to open the following New Project dialog.  Select the Cloud template folder under the your favorite language folder (C#).  Note: Be sure to create the solution in a folder that is part of your local workspace for the Team Project that was selected.  This will help ensure the easiest process for checking in your files.

image

The New Windows Azure Cloud Service dialog appears where you can select the different types of cloud service projects.  In this example, I chose ASP.NET MVC 4 Web Role because my system is going to have a front end website for capturing orders.  I also added a Worker Role for order processing that will be used to process the orders is a background process.

image

The New ASP.NET MVC 4 Project dialog will prompt you to select the appropriate project template.  Note:  Now included are the Single Page Application (SPA) and Face Application project templates that were added with Update 2.

image

Once the solution has been created, I made a simple change to update the name of the home page title and checked in the entire solution.  Before I checked in, I noticed that the linking process automatically created the CI build definition but the selected project was blank other than the deployment settings and the build was disabled.  There must be a process that waiting for the first check in to identity the appropriate solution to be used in the build definition.  Once I checked in, the build was enabled and started.  It also has the appropriate project selected.  After a few minutes the build completed and my application was deployed.

TFS deployed cloud service

Using the URL above, I can view my website. 

image

When I go back into view the Cloud Service in Windows Azure.  You can see that it shows my deployment from TFS and notice that it deployed to the staging environment as the default deployment setting.

View deployment history for your Azure Cloud Service

Also, notice that both the web role and the worker role projects have been deployed and they are running.  I can verify everything is working in staging.  To promote this to the production instance, you can choose the Swap option highlighted below.  This performs a swap of the production and staging virtual IP addresses.  This allows for minimal downtime and a simple way to rollback by performing the swap a second time.

VIP Swap to switch production and staging sites

Summary

As you can see there is strong integration between Windows Azure Cloud Services and Team Foundation Service that is simple to implement.  This integration provides a great out of the box (OOB) solution for Continuous Integration and Delivery.  Try it out today.

Thursday, April 18, 2013 7:32:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
ALM | Continuous Integration | Team Foundation Service | Visual Studio 2012 | Windows Azure

# Thursday, March 28, 2013

You have started writing your first Windows 8 Store app and now you are asking yourself, "Can I set up Continuous Integration (CI) for Windows 8 Store apps like I have done for other projects?"  The answer is yes. By configuring CI for your Windows 8 Store apps, your apps can take advantage of immediate notification at compilation and unit test failures at each check in.  There are a couple things that make Windows 8 Store app development unique that require a few steps to configure.  I will walk through those unique items, show you how to configure the build machine, and show you the results of a successful build.

The TFS Build Agent typically performs the majority of the work during a Team Foundation Build process.  Windows 8 Store apps require that the build agent be installed on a Windows 8 client or Windows Server 2012 machine. This also means that Windows 8 Store apps will not be able to be built using the Team Foundation Service Hosted Build Service.  If you are using TF Service, one option is to use these instructions to configure a local Build Server and use it with the TF Service.

Unit Testing

Windows 8 Store apps include a separate project template for testing Windows 8 applications and class libraries.  This project is designed to only allow valid Windows 8 assemblies and references.  Additionally the unit test project can help validate the appropriate application capabilities are set by having a package manifest for the unit test project.   Visual Studio 2012 Update 2 includes two improvements for unit testing in Windows 8 Store apps:

  • [UITestMethod] – Decorate your test methods with this attribute to run on the UI Thread without having to write your own Dispatcher plumbing.
  • Assert.ThrowException<T> method provides a more fluent way of writing unit tests that are expecting exceptions to be thrown.

More information on these features in Update 2.

Configuration

The following list contains the primary requirements for configuring a build machine to build and run unit tests for Windows 8 Store apps.

  • Build Agent should be tagged with “Win8” or “Win8StoreApp”.
  • Visual Studio 2012 must be installed on build server (Premium or Ultimate for Code Coverage).
  • Build Agent must be configured to run interactively.
  • Windows 8 Developer License must be installed.
  • The Security Certificate for the Unit Test project must be installed.

Install and Configure Build Agent

First, install and configure the TFS Build Service on your selected Windows 8 or Windows Server 2012 build machine.  Use the following article, Install Team Foundation Build Service to install and configure the Build Service. Once the Build Service is configured, open the build agent properties from the Team Foundation Server Admin Console and add a new Win8 tag to ensure that the application is built by the appropriate build agent if you have multiple agents configured.

Tagging Build Agent with Windows 8 tag

 

Install Visual Studio 2012

In order for Windows 8 Store apps to build, Visual Studio 2012 must be installed.  If you want to capture code coverage results, install the Premium or Ultimate editions otherwise you can install the same edition you are using to develop.

At this point, your Windows 8 Store apps will successfully build on the server.  We will perform the remaining steps to configure the build machine for testing.

Run Build Service Interactively

The Windows Store app unit tests must be able to interact with the desktop. This requires the build service to be configured to run interactively or else you will get the following error:

Could not start the test run because Unit tests for Windows Store apps cannot be run from a service or non interactive process. Please run unit tests from an interactive process.

To configure the Build Agent to run interactively, log into the machine as the user you want the build to run under.  This can’t be Network Service.  The build service user must also:

  • Have administrative permissions on the build machine
  • Be a member of the Team Foundation Server build service account group
  • Have Change and Read permission to the drop folder identified in any build

Open the Team Foundation Server Administration Console.  Under Build Configuration, stop the build service and then open the Properties dialog.  Ensure the service is running under the appropriate user and check the Run the Service Interactively checkbox.  Click the Start button and this will open a command dialog and specify the Build Agent is running in interactive mode.

image

Install Developer License

If you tried to run a Windows 8 Store app build with unit tests, it would generate the following error that there is no valid developer license found.

Could not start the test run because No valid developer license found for running unit tests for Windows Store apps. Please install/renew your developer license.

There are several methods for installing and managing Developer licenses see Get a developer license (Windows Store apps) for a comprehensive list.  Here we will acquire it through PowerShell because I am currently logged in as the build agent user without a workspace configured to open the solution.

Run the Show-WindowsDeveloperLicenseRegistration cmdlet in PowerShell with elevated permissions. This opens the dialog below. 

Getting developer license for Windows Server 2012 using Show-WindowsDeveloperLIcenseRegistration

Agree to the license and it will prompt you for you Microsoft Account credentials to acquire the developer license.  Once this has been installed, you will have a developer license for the next 30 days.

Now, if you were to try to run a build now, you would get a certificate error from the unit test project.

failed with Error: (0x800B0109) A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider. (Exception from HRESULT: 0x800B0109).For more details look into Event Viewer under Applications and Services Logs -> Microsoft -> Windows -> AppXDeployment-Server -> Microsoft-Windows-AppXDeploymentServer/Operational.

Install Unit Test Certificate

As the message above shows we next need to install the Unit Test project’s certificate on the machine so it will be trusted.  You can install the .PFX file that is located within the Visual Studio project, but it is recommended that you install .CER certificate file.  There are several ways to generate a .CER file. In this example, we will create the .CER file by creating the Unit Test project’s App Package.  From your development machine, open the solution and right click on the Unit Test project (not the Windows Store app project) and select Store > Create App Packages.

Create Unit Test App Package for Security Certificate

The Create Your Packages wizard will open and ask you if you want to upload to the Windows Store.  Choose no because we just want to create a local package to get the .CER file.  Next keep the defaults but verify at least one architecture is selected.  Click the Create button to initiate the building of the Unit Test project’s app package.  Once it has completed, the dialog will include the link to the files. Click on this and open the appropriate version’s folder.  Within the folder, there are several files including the Security Certificate file (.CER). 

Output from building a Windows 8 Store app package

Copy this file to the build machine.  From the build machine open a command prompt window with elevated permissions.  Run the following command to install the certificate to the local store.

Certutil –addstore root your_unit_test_project.cer

When this has completed, it will display that the command has successfully completed.  This completes everything you need to configure a Team Foundation Build Machine capable of compiling and running unit tests for Windows 8 Store apps.

Creating the Build Definition

Now that all of the requirements for building Windows 8 Store apps has been met, let’s create a CI build definition to verify everything has been correctly configured.  In general, the build definition is similar to other CI build definition.  There are a couple differences highlighted below.

Create the build definition by choosing New Build Definition by selecting the option in the Builds tab of Team Explorer.  Under the Trigger tab, choose Continuous Integration for the build to run after each check-in.  Next, in the Workspace tab, ensure the appropriate node is selected.  This is typically mapped at the Team Project or branch level.  In the Build Defaults tab, enter a network share where the output can be copied at the end of the build definition.

Within the Process tab, you will select the Windows 8 Store apps to build (if the solution was open when you created the build definition it will automatically populate as the solution to build.  Next you need to change the Automated Tests search path to be **\*test*.appx to match the special extension of the Windows 8 Store app unit test project.  Also, you will need specify the name of the tag you used when configuring the Build Agent.  In my instance, I used Win8.

Build definition settings for Windows 8 store app

Save the build definition.  To manually trigger the build, right click on the definition and select Queue New Build.  Keep the defaults and click Queue to start the build.  If your Windows 8 Store app includes a unit test project it will automatically execute the unit tests and report the results back to the build summary.  After the build completes, the build summary should look similar to this.

Build summary report for Windows store app with unit tests

Whether you are building Line of Business (LOB) Windows 8 Store apps or working on the next million dollar app idea, you can now utilize the benefits of Continuous Integration with Team Foundation Server and Team Foundation Build.
Thursday, March 28, 2013 9:26:00 PM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
Team Build | Team Foundation Server | Windows 8

Visual Studio ALM MVP
Microsoft Visual Studio ALM MVP
Archive
<April 2014>
SunMonTueWedThuFriSat
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2014
Mike Douglas
Sign In
Statistics
Total Posts: 97
This Year: 3
This Month: 1
This Week: 0
Comments: 82
All Content © 2014, Mike Douglas
DasBlog theme 'Business' created by Christoph De Baene (delarou)