Virtual machines that are hosted on-premises and in Azure are great resources for building lab environments for use in automated testing. Lab Environments in Visual Studio 2012 and 2013 ALM provide two levels of functionality. Both Standard and SCVMM Lab Environments allow teams to execute workflows for build-test-deploy systems into test environments. SCVMM Environments utilize Hyper-V and provide some additional benefits of being able to snapshot and rollback environments. One use of these environments that I have helped clients implement, is building environments with only UI test clients to execute automated UI tests against an environment that is outside of the Lab Environment. This allows automated UI tests to be distributed across all of the machines in the environment to execute the tests in a shorter timespan.
One thing we discovered when running automated UI tests in the lab environments is that the resolution is 1024 x 768. While websites should provide a responsive interface, this is not the typical resolution of most users today. Furthermore, I may want to specifically test a series of different resolutions. Unfortunately there isn’t a way to change this through the environment settings nor on the local machines. I created a small utility that provides a mechanism for changing the screen resolution that can be run as part of the automatic login process. This utility changes the resolution to the specified setting.
changescreenresolution 1920 1080
Not all screen resolutions are supported by all virtual machines. In addition to changing the resolution, you can specify a SendGrid account to send an email with the default resolution, available resolutions, and the final resolution after the change. The formatting in the email is very simple but effective.
ChangeScreenResolution is a free and open source project hosted on GitHub at:
You can download the files from my OneDrive account at:
To use, follow these steps:
1. Copy the files to any location on the virtual machine.
2. Optionally add the SendGrid account info to the config file and enable email
3. Create shortcut and add to startup folder (use shell:startup in Windows 8/8.1 to get to the startup folder)
4. Add the desired resolution to the shortcut (1920 1080 is the default)
5. Restart Virtual Machine
Enjoy! Let me know if you want any additional features.
TFS 2015 CTP 1 was made available giving us our first chance to try out TFS 2015. If this list of features looks familiar, you have probably already read and seen these on Visual Studio Online. Even though the features are available today in Visual Studio Online, most of my customers are using TFS, so this is great to see the updates being on-premises. In this post I will share some of my first impressions with TFS 2015 CTP 1. I will run through the install process, highlight some of the new features, and talk about what is still to come. Keep in mind this is just the first CTP, so a lot may change by the RTM.
Installation and Configuration processes are very familiar to TFS 2013 with some slight tweaks. For example the Standard Single Server and Advanced options have been combined and is now called Full Server. There wasn’t an option to install SharePoint Foundation and there are some changes with the build service. I think the install and configuration process was very smooth with some good tweaks.
Creating a new Team Project was very much the same process as before. I used Visual Studio 2015 CTP 6, also released yesterday to create the project. I noticed that the process template is still 2013.4. Not sure if these will be updated or not.
I took a quick tour around the new features in TFS 2015 using the release notes. Below is the full list of changes and updates.
Let’s take a look at couple below.
Edit on Kanban Board – The Kanban board is one of the features I often heard from customers that they want it to be more flexible and functional. While CTP 1 doesn’t contain the latest Kanban improvements on Visual Studio Online, the most requested features are still on the features timeline for TFS 2015.
Basic License Expanded – This is huge for many of my customers. Today, Scrum Masters that want the portfolio backlog tools and web chart authoring need an MSDN license. This to me (always verify with Microsoft) means that most of these users will now only need a TFS CAL.
Testing Web Charts – This wasn’t in the list but I’m glad this feature made it to TFS 2015. This will make displaying test results to the team much easier.
Overall, my first impression was very positive. The entire process was very clean and stable. Obviously we can’t install this in production yet but it shows promise that TFS 2015 will be another impressive release.
There are also still lot of features as Brian Harry noted so don’t get too too hung up on the current list of new features. He mentions more Git and Agile project management improvements and the new Build.vNext engine. Stay tuned and we will follow the road to TFS 2015 RTM together. Microsoft isn’t going to stop when TFS 2015 hits RTM. As Brian Harry mentions, this will simply begin a new wave of updates.
While I just highlighted a few features, I encourage you to take a look at the release notes to read about all of the features and remember the quickest and easiest way to try out these new features is to create your free account on Visual Studio Online.
Do you know if your site is up and running? How responsive is your site? If your application is generating errors, do you know that? Do you know the features and demographics of the users? If you are not sure or answered no to any of these questions, Application Insights is powerful tool that can help you understand the availability, performance, and usage of your application.
Application Insights is a cloud based tool by Microsoft that allows you understand your application’s availability, performance, and usage. Currently available in preview, the tool is available for a number of platforms including ASP.NET web applications and WCF services, Windows Phone and Windows Store apps. Microsoft has recently announced the purchase of HockeyApp that will add support for mobile devices.
The following post will show how to add Application Insights in just a couple steps to start betting understanding your application.
There are two basic requirements to getting started with Application Insights. The first requirement is a Microsoft Azure account. You can create one a number of ways including activating your MSDN Azure benefits. This doesn’t require a credit card and provides you with $50, $100, or $150 of discounted Azure spending each month. There is no better way to get started trying out all of the Azure features. Second, Application Insights has worked with a number of updates in Visual Studio 2013, but I would recommend installing VS 2013 Update 3 or greater to get the best experience and utilize the Azure portal version. Prior to Update 3, the previous version of the client tools used Application Insights in Visual Studio Online.
Add Application Insights to a New Application
To add Application Insights for a new project, check the box to Add Application Insights to Project in the new project wizard. Select your account and the location where to send the telemetry data. In this case I chose a new project based on the name of my application. The dialog gives you the control to choose the exact settings you want. Once you have created your application and run it for the first time, it will immediately begin sending telemetry data.
Add Application Insights to an Existing Application
In many cases you will have existing applications that you want to begin capturing telemetry data. Fortunately adding Application Insights to your existing application is almost as simple as setting it up for a new application. Basically there is only one additional step.
Here we have an existing ASP.NET MVC application. To add Application Insights, right click on the project and choose the Add Application Insights Telemetry option.
This adds the necessary configuration, creates the resource in Azure, and installs NuGet packages to your application. At this point, the all of the telemetry data is configured to send except for the client side capturing.
The one telemetry item that isn’t automatically configured when setting up Application Insights for existing applications is the end-user usage analytics. For a new MVC application this is added to the layout page. For an existing application, we need to go to the Azure Portal, choose Quick start > Add code to monitor web pages.
This displays the required code for your application with your specific instrumentation key already included. Copy this to the clipboard.
With this, paste the code into the layout page just as the new project wizard would have done like this.
Run the application and it will start sending telemetry data.
As you can see, in just a couple steps you can add Application Insights telemetry data to your new and existing applications. Use this to understand your application’s availability, performance, and usage.
New features are being release for Application Insights on a regular basis. Follow these links for the latest updates.
Announcements on the Microsoft ALM Blog
Release Notes on Microsoft Azure
The Kanban board in TFS 2013 allows each team to have their own custom Kanban board. Each team can customize the columns displayed and map them to appropriate states. However, beyond the cumulative flow diagram (CFD), these custom columns can not be used with queries or reports. In order for the columns to be included in reports and queries, the work item states need to be modified to represent the columns. By specifying the custom states, this typically forces all of the teams to use these states. Teams will usually want their own states.
One way I found to allow teams to define their states and have them show up for reports and queries is to create a separate work item for the Kanban boards that contains the superset of all of the states for all of the teams. Each team can select the applicable states and only those states would show up in reports, charts, and the CFD. I prefer to create an additional work item such as Card or Support Item instead of modifying the User Story and use it in the Kanban board because the current user story states work well for Scrum and we want to be able to use Scrum and Kanban from the same Team Project. The new work item will need to be added as a requirement and added to backlog. There is a great article on MSDN explaining the steps for this.
For example, let’s assume Team A and Team B want the following states below. Some are shared by both teams but others area only used by Team A. The superset of these states would be added to a custom work item similar to (usually copied from) the User Story. In the state workflow, you would want to create transitions between all combinations of states to allow teams to move between any possible combination of states that each team wants to utilize.
|Team A ||Team B|
|Release Ready || |
|Prioritized Ready ||Prioritized Ready|
|Analysis Active || |
|Development Ready ||Development Ready|
|Development Active ||Development Active|
|Test Ready ||Test Ready|
|Test Active ||Test Active|
|UAT Ready || |
|UAT Active || |
Each team can customized their own Kanban board to use the columns they want. Reporting by team will only show the states that each team uses.
I haven’t had a chance to verify every aspect of this but possible downsides could include:
- Opening the work items will show all of the states. There is no way to filter just for the team.
- With multiple work item types available for the Kanban board (User Story and new work item) with different states, the columns have to be mapped/hidden before it will display properly.
- I might not be thinking of everything from a reporting standpoint.
Let me know if you have any feedback or find any holes in the approach.
The Visual Studio Online REST APIs provide rich access to integrate and extend the functionality of the Visual Studio Online (VSO). The VSO REST API allow for almost any type of client application to communicate with it. To access the VSO REST APIs, there are two types of authentication, Basic Authentication and OAuth 2.0 that are provided. Basic authentication is very simple to implement but requires the calling application to store the username and password of the user’s VSO alternate credentials. Each call to the VSO REST APIs require the username and password to be passed with it. OAuth 2.0 allows for federated access and that the user will authorize your application to access VSO on that user’s behalf. One of the key benefits of this is that your application will never need to store and pass a password for your application to access the VSO APIs. Instead the user will receive both an Access Token and Refresh Token. The Access Token is valid for about 15 minutes and is what is required to send with each VSO API call. The Refresh Token needs to be persisted and used to renew the Access Token after it expires.
This post focuses on creating an Authorization Filter to leverage a reusable component for your ASP.NET MVC application when connecting to the Visual Studio Online REST APIs. To learn more about connecting to the VSO REST API, how to address common integration and extension scenarios, and access to the full source control for this sample and a Portal Class Library for connecting to the REST API, take a look at this book by Jeff Bramwell and I, Extending Team Foundation Server and Visual Studio Online.
Once an application has been linked to VSO and the user has authorized access, you application must implement the process above to access VSO to retrieve the list. In this simple example I am not using any kind of site authentication. I am using a Guid in a cookie for storing a key back to the user table that contains the Refresh Token. In my next post, I will replace this Guid with Individual Account authentication using ASP.NET Identity 2.0 and federation using Google/Microsoft accounts. The method below retrieves a list of Team Rooms and displays it in a view. the is accomplished in the last two lines of code. The other lines of code are to implement the process in the diagram above.
This is a lot of code that will need to be repeated for each action that calls the VSO REST API. One way to make this reusable and to keep the controller action clean is to use an ASP.NET MVC Action Filter. These filters can be called at the controller level or action level. In this case we are going to use an Authorization Filter. An Action Filter is implemented as an attribute. You can create one by inheriting FilterAttribute and implementing the IAuthorizationFilter interface.
public class VsoAuthorizeAttribute : System.Web.Mvc.FilterAttribute, System.Web.Mvc.IAuthorizationFilter
Moving the code to use the filter is mostly straight forward. Implement the OnAuthorization method passing an AuthorizationContext object. This context provides access to the cookies and session objects. However, even though you can retrieve the controller objects, it doesn’t have access to the RedirectToAction method because it is protected. You can create a CollectionBase object and implement it as a public method so it can be accessed it from the filter. Below is the Authorization Filter.
To implement the Authorization Filter, simply add the attribute to each controller action that requires access to the VSO REST APIs. The filter will be execute before the method and validate that there is a valid Access code before executing the details of the method. Even if the application needs to redirect the user to the authorization or renew actions, the ReturnUrl parameter will return the user back to this action once they have a valid Access Token.
Jeff Bramwell and I are pleased to announce the first major update to our book, Extending Team Foundation Server and Visual Studio Online. Back in May we published the initial release and we have since been working on our these next two chapters. We had planned to release more often but the summer has been busy with family fun and vacations. Thanks for your patience and we will continue to release additional chapters as we complete them and Microsoft releases new REST APIs for VSO.
This release includes a number of fixes and two additional chapters:
- Chapter 15 – Service Hooks – Configure specific events in Visual Studio Online to send information to one of many supported services such as Trello or to a customer service.
- Chapter 17 – Using OAuth – Leverage OAuth authentication that doesn’t require storing user credentials in your application to communicate with the Visual Studio Online REST APIs.
Don’t forget the book includes fully functional sample code showing you how to access the VSO REST API included a Portable Class Library (PCL) client library for accessing the service across any number of .NET Platforms. The client library has been updated to support OAuth authentication and there is a new sample Web Hooks project demonstrating how to receive events from VSO.
If you have already purchased the book, thank you! You should have received notification of the update. If you haven’t purchased it yet, you can still buy it at the discounted price of $4.99.
Feedback has played a major role in this process and we hope to continue this to help ensure we are releasing the book that you want and need. Please tell us what you think so far and the types of projects you are developing using the VSO REST API and the book at our feedback forum.
Microsoft has just made Visual Studio 14 CTP available to the public to try out the new features such as ASP.NET vNext and the new Roslyn compilers. Microsoft wants your feedback to let them know what you like and don’t like.
Downloads: Download the Visual Studio “14” CTP (also available on MSDN subscriber downloads). Alternatively, save some time and use the provided VM in Azure.
Blogs & Release Notes: Read announcements by Soma & Brian. Check out the team blogs, including Visual Studio, Web Dev (web tooling), Web Dev (ASP.NET vNext), Entity Framework, C#, VB, and C++. See the Visual Studio “14” CTP release notes for a list of new features. Discuss on Facebook & Twitter.
Known Issues: This release should be installed in a test environment, such as a VM or a clean machine. Do not install on a machine with another version of Visual Studio installed. For other known issues, please see the Visual Studio “14” CTP KB.
Feedback: Submit bugs through Connect, suggestions on UserVoice and quick thoughts through Send-a-Smile in the Visual Studio IDE.
The is an early CTP so don’t install on a production machine or one that has another version of Visual Studio. Therefore, your two best options are to download Visual Studio 14 CTP and install it on a Virtual Machine or try it out by spinning up a new VM from the Virtual Machine Gallery on Microsoft Azure. Don’t forget if you have an MSDN license, you get free credits towards Azure each month. Sign up now and try it out.
Visual Studio 14 CTP in the cloud
We’ve all downloaded and installed a version of Visual Studio in the past, so let’s see how easy it is to get Visual Studio 14 CTP up and running in Azure.
After you have signed up for an Azure account, launch you browser to http://manage.windowsazure.com (or http://portal.azure.com if you want to check out the new portal interface). Click the plus in the bottom left corner to begin creating the new virtual machine.
From the New menu select Compute > Virtual Machine > From Gallery
There are a number of pre-configured images to speed up your deployment time. Depending on your account, your list may vary. How cool is this to be able to run Visual Studio in the cloud?! Imagine, you can use Visual Studio from your IPad! Oh wait, there isn’t a keyboard or a mouse. Maybe we better stick to running it in the cloud from our Surface. How can I access my source control? Oh yeah, that is in the cloud too on Visual Studio Online!
Ok, once you select the Image you want to use, give the VM a unique name. Also select the Tier. I recommend choosing the Basic Tier since you don’t need any high availability type features and I’m sure you want to stretch your monthly credits as long as possible. Next provide the size, username, and password.
Select whether to add this to an existing cloud service or a new one. I chose to create a new cloud service. Also give it the DNS name, probably keep it the same as your machine name to keep it simple. Choose a region close to where you are located.
Last, keep the defaults unless you want to configure any additional extensions.
You will see it starting up and provisioning.
Once it is ready, choose connect to open the RDP connection.
Starting Visual Studio 14 CTP!
Create your new project and run!
Don’t forget to send a smile to the product team and let them know what you think!
Last week, at TechEd North America, Microsoft announced the availability of a new API being provided by Visual Studio Online. This API is based on REST, OAuth, JSON, and Service Hooks. While this new API is still in preview mode there is still a lot of functionality that can be taken advantage of by your custom applications.
While a great deal of documentation is being provided by Microsoft, I and Jeff Bramwell (a fellow Visual Studio ALM MVP) have started writing a book on this very topic titled “Extending Team Foundation Server and Visual Studio Online”. The primary focus of this book will be to provide scenario-based examples on how to utilize the new REST-based APIs and Service Hooks. Based on our everyday experiences with TFS and Visual Studio Online, along with feedback from our readers, we plan to provide a book that will be simply indispensible for anyone wishing to extend TFS or Visual Studio Online using the new API.
Our intention is to release the book in stages, as we complete new chapters. As of this posting, we are officially making the initial version available with planned releases roughly every two weeks – until the initially defined table of contents has been completed. This model will also allow us to address changes and updates to the API as Microsoft moves from preview to release.
To accommodate the phased release, we will be publishing the book as an eBook in PDF, ePub, and MOBI formats. The initial cost of the book will be $1.99 and the price of the book will gradually increase as we release new content. Once you purchase the book, you will get all future releases at no additional charge. So, the earlier you buy in, the better the price!
The initial table of contents for the book is as follows (though subject to change):
Part I – The Basics
Chapter 1: Overview of Team Foundation Server
Chapter 2: A History of Team Foundation Server APIs
Chapter 3: A REST Primer
Part II – Using the Team Foundation APIs
Chapter 4: Our First REST API Call
Chapter 5: Work Items
Chapter 6: Team Foundation Version Control
Chapter 7: Git
Chapter 8: Build Definitions
Chapter 9: Builds
Chapter 10: Workspaces
Chapter 11: Team Room Management
Chapter 12: Team Room Activities
Chapter 13: Reporting and Charts
Chapter 14: Projects and Teams
Chapter 15: Service Hooks
Part III – Other Resources
Chapter 16: Using Fiddler
Chapter 17: Using OAuth
The chapters listed in bold have been at least partially completed and are included in the initial release of the book.
If you have an interest in extending Team Foundation Server and/or Visual Studio Online, then this is (will be) the book for you. Purchasing the book now locks in all future updates for only $1.99!
You can read more about the book and purchase it here. Please utilize the feedback section on the book site if you have any questions and/or suggestions. We welcome any and all feedback – especially if it helps us to provide a better, and more useful, book for everyone.
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.
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.
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.
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.