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.
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!
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.
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.
Most of the posts suggested deleting the IISExpress folder under documents because it recreates it the next time an application is run.
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.
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.
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.
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!
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.