Azure Application Insights is a great offering provided by Azure for Application Performance Monitoring. It’s very easy to integrate it with your applications and now App Insights provide a fantastic capability to create work items for the issues shown in Application Insights in Visual Studio Team Service or GitHub. In this article we will discuss about creating work items in Visual Studio Team Services.

I have created an ASP.Net Core MVC web application using the template provided by Visual Studio and hosted it on an App Service web app. Then to simulate an error in the application, I added code to throw a SecurityException when you navigate to Contact view. These exceptions will be shown in the Application Insights. Pretty simple setup.

0-app-insights

You can see the logged exceptions, when you click on the exceptions section, you will be taken to the Failures blade. There you can see all the exceptions and some related information.

1-app-insights-faliures

If you select one of the exception types, you will see more details and you can scroll through and select an exception to see the detailed information.

2-select-exception.png

Then you are taken to the blade where you are shown the End-To-End Transactions for the selected exception.

3-end-to-end-transaction.png

Here you can see the exceptions details including the message, event time, exception type, custom data and the call stack for the exception. And on this blade, you can also see a button called Create Work Item.

4-configure-work-item-integration

When you click on the button, you are taken to the New Work Item blade. If you have not already configured the work item tracking system, you are shown a link to Configure work item integration. In the configuration blade you can select the Tracking System. You have the options to select Visual Studio Team Service and GitHub. We will be using Visual Studio Team Services for this post. Next you need to select the URL for the Work Item tracking system. And then add the Project Name. Then you need to authorize Azure to access your Visual Studio Team Services instance. Click on the Authorize button to proceed.

5-authorize.png

Then you will be presented a browser window to allow access to Visual Studio Team Services for Azure. Click on Accept to proceed. Then you need to add the Area where your work item will go in to. The default Area will be under the project name. So, I have added that. To see how you can create new Areas, follow this documentation link.

6-add-area-click-ok

Also, here you can add a user in Visual Studio Team Services to assign this work item to. Add the user you want to assign this item to Assigned To text box. The once you are done, click on OK button to continue. Then you are taken back to the New Work Item blade.

7-add-work-item

Here also you have to option to change the Title of the Work item, change the Area and Assigned To option. The Details will automatically be populated with details collected from the exception.  You can add your own here as well. Then click on Ok to create the work item.

8-work-item-added

Now if you go to your Visual Studio Team Services instance and navigate to the Work Items section in your project, you can see the new Work Item, which is a Bug that was added from within Application Insights.

9-work-item-with-details

If you open up the Bug, then you can see the basic information is already added including the Description. The description contains the information taken from the exception. And you will also have the links to go to the Azure portal to see the exceptions details and the related information.

So, you can see that its really easy now to add work items to your Visual Studio Team Services instance directly from Application Insights whenever you see an issue in application insights, without having to navigate to Visual Studio Team Services and manually add all the information, which is absolutely great.

 

Advertisements

2 thoughts on “Create Work Items In Visual Studio Team Services Directly From Application Insights Inside Azure Portal

  1. I agree, this is absolutely great!
    However, what’s not so great is that new work items created by my teammates are logged as having been created by me because I was the one to authenticate the connection.
    How can we correct the behavior so that the work item created by field accurately reflects the actual creator?

  2. Another issue… We have defined a Default value for the Repro Steps field in a Bug to have a template of what we want the Bug report to contain. However, new Work Items created through App Insights doesn’t include this template. Is it possible to respect the Default value we’ve defined and simply append the App Insights info rather than replace the Repro Steps field contents entirely?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s