Hands-On Lab
Integrating Development and Operations with Visual Studio Team Foundation Server 2012 and System Center Operations Manager 2012
Lab version: 11.0.51106.01 Update 1
Last updated: 2/4/2013
ContentsOverview 3
Exercise 1: Monitoring Applications with System Center Operations Manager 4
Exercise 2: Synchronizing System Center Operations Manager Alerts with Team Foundation Server 2012 12
Exercise 3: Controlling IntelliTrace in Production using System Center Operations Manager 27
Overview
In this lab, you will learn about how communications and workflow between operations and development teams can be improved by utilizing System Center Operations Manager 2012, Team Foundation Server 2012, and Visual Studio Ultimate 2012. As you walk through the exercises, you will see how Operations Manager can monitor a sample ASP.NET website, synchronize select operational alerts with Team Foundation Server, and automate the collection and delivery of IntelliTrace logs to the development team.
Prerequisites
In order to complete this lab you will need the Microsoft® Visual Studio Team Foundation Server® 2012 and System Center® 2012 Operations Manager Integration Virtual Machine provided by Microsoft. For more information on acquiring and using this virtual machine, please see this blog post.
About the Fabrikam Fiber Scenario
This set of hands-on-labs uses a fictional company, Fabrikam Fiber, as a backdrop to the scenarios you are learning about. Fabrikam Fiber provides cable television and related services to the United States. They use an on-premises ASP.NET MVC application for their customer service representatives to administer customer orders.
Their IT operations team uses System Center 2012 to monitor their on-premises applications for any performance problems, outages, or other incidents. Recently the CIO of Fabrikam Fiber launched an initiative to encourage development and operations organizations to work more closely together in order to better ensure the quality of their production systems and to more efficiently resolve incidents. These two teams have recently decided to integrate System Center Operations Manager and Team Foundation Server to make it easier for developers to get the information they need about production incidents in order to turn around fixes more rapidly.
Exercises
This hands-on lab includes the following exercises:
1. Monitoring Applications with System Center Operations Manager
2. Synchronizing System Center Operations Manager Alerts with Team Foundation Server 2012
3. Controlling IntelliTrace in Production using System Center Operations Manager
Estimated time to complete this lab: 60 minutes.
Exercise 1: Monitoring Applications with System Center Operations Manager
In this exercise, you will see how System Center Operations Manager (SCOM) can be configured and used to help monitor a web application. We will then use this as the foundation on which we will begin showing the integration story with Team Foundation Server 2012 in the next exercise.
1. Log in as Administrator. All user passwords are P2ssw0rd.
Note: To help ensure that all services and applications are ready for the remainder of this lab, please allow the machine a few minutes to warm up.
2. Let’s start by taking a look at how we pre-configured application monitoring for a sample website using SCOM. Start the Operations Console from the taskbar.
Figure 1
Launching the Operations Console
3. Load the Authoring workspace.
Figure 2
Authoring workspace
Note: The Authoring workspace enables you to create new monitoring scenarios so you can change or add monitoring in an existing management pack or create a new management pack for an application that does not have one.
4. From the Authoring tree, select the Authoring | Management Pack Templates | .NET Application Performance Monitoring template node. This displays the Monitor FabrikamFiber website management pack in the middle pane.
Figure 3
Selecting a template
5. Select Monitor FabrikamFiber website from the middle pane and then select the Properties option from the Tasks pane.
Figure 4
Viewing properties
6. The first tab in the properties window is labeled What to Monitor. This tab describes the application components to monitor, which is just the FabrikamFiber.Web website in this case.
Figure 5
Monitored application components
7. The next tab allows configuration of the Server-Side Defaults. Select the Advanced Settings button.
Figure 6
Configured server-side monitoring settings
8. In the advanced settings window, note that both performance and exception alerts are turned on and that the sensitivity threshold has been adjusted down to 100 ms. This was done ahead of time for demonstration purposes.
Figure 7
Advanced monitoring settings
9. Under the section for configuring exception event monitoring, note that the “Application failure alerts” and “All exceptions” options are selected. This will alert us to all application failures and exceptions.
Figure 8
All failures and exceptions are set to be logged
10. Select the Cancel button to close the advanced settings window.
11. Select the Client-Side Monitoring tab in the properties window. This tab configures the use of client-side monitoring in managed web applications.
Figure 9
Client-side monitoring configuration
12. Select the Client-Side Defaults tab in the properties window. This configuration tab is similar to the Server-Side Defaults tab in that it controls what events to monitor. It also provides advanced settings and the ability to filter clients to monitor by IP address.
Figure 10
Client-side defaults
13. Select the OK button on the properties window to close it. This will save changes and prepare the monitoring configuration.
14. Return to the Monitoring workspace.
Figure 11
Monitoring workspace
15. In the Monitoring tree, select Monitoring | Application Monitoring | .NET Monitoring | Monitor FabrikamFiber website | Monitor FabrikamFiber website. This shows us that the website is currently in the Healthy state. SCOM provides a number of different views that can be used to view the state of applications and gain performance insights.
Figure 12
Overall state of the website
16. Select the row describing the state of the website and then select the Alert View navigation option from the Tasks pane.
Figure 13
Opening the Alert View
17. The Alert view shows all alerts and their details for the monitored website. It also allows you to disable or override the rule that produces the warnings, create an alert subscription to send email or text message, and even collect IntelliTrace snapshots. Select one of the alerts listed by single-clicking.
Figure 14
Alert View showing existing alerts
Note: The initial alerts and timestamps that you see in screenshots may be different from those you see in the virtual machine.
18. In the Navigation section of the Tasks pane, select the Performance View option.
Figure 15
Navigating to the Performance View
19. Scroll through the list of performance counters to see what counters are currently collected and available for display. You can also specify a time range and export data if desired from this view.
Figure 16
Performance View counters
20. Close the Performance and Alert windows. At this point, SCOM has been configured and is now monitoring the application. In the next exercise, we’ll take a look at how you can integrate this monitoring setup with Team Foundation Server to help improve the workflow between operations and development.
Exercise 2: Synchronizing System Center Operations Manager Alerts with Team Foundation Server 2012
In this exercise, you will see how SCOM can synchronize alerts and work items with Team Foundation Server to improve the communication and workflow between operations and development. In this lab and virtual machine, we are working with Team Foundation Server 2012 Update 1, but it is also possible to synchronize with Team Foundation Server 2010.
1. Let’s take a look at how SCOM was configured to integrate with Team Foundation Server. In the Operations Console window, select the Authoring workspace.
Figure 17
Authoring workspace
2. From the Authoring tree, select Authoring | Management Pack Templates | TFS Work Item Synchronization.
Figure 18
TFS Work Item Synchronization
3. Select the template instance named FabrikamFiber TFS Syncing from the middle screen and then select the Properties link in the Tasks pane.
Figure 19
Viewing properties for work item sync
4. In the Server Settings tab, note the configured Team Project Collection URL.
Figure 20
Team Project Collection URL
5. Select the Project Settings tab and note that an application component mapping is already setup between the Fabrikam Fiber website and TFS. In addition, the area path is setup so that work items will be created in the Web Site area. These settings make it possible for operations to send alerts in the form of Operational Issue work items when a problem is found in production that the operations team can’t resolve.
Figure 21
Project Settings
6. Select the Cancel button to close the FabrikamFiber TFS Syncing Properties window. Select the No button if prompted to save changes.
7. Minimize the Operations Console window.
8. Now let’s take a look at a scenario where a runtime issue is picked up in SCOM and then passed on from operations to development for further investigation.
9. Start Internet Explorer and then select the Fabrikam Fiber Intranet button from the Favorites bar.
Figure 22
Launching website
10. Select the Reports link in an attempt to view reporting data, but note that there is an error.
Figure 23
Reports link
Note: The website layout changes depending upon the window size, so the navigation links may also appear on the left-hand side in some cases.
Figure 24
Unhandled exception occurred while generating report
11. It appears that there was an unhandled error generating the reports, and since we have SCOM monitoring the website, we can use that to take a closer look. Return to the Operations Console window and select the Monitoring workspace.
Figure 25
Monitoring workspace
12. From the monitoring tree, select Monitoring | Application Monitoring | .NET Monitoring | Monitor FabrikamFiber website | Active Alerts.
Figure 26
Active alerts for the website
13. In the Active Alerts view, you will notice a few warnings and errors. In an active production application, it is likely that there would be even more to sift through. To make it easier to find the recent exception, let’s customize the view a little. Select the Personalize View button from the Tasks pane.
Figure 27
Customizing the alerts view
14. In the Personalize View dialog, select the Last Modified column and then select OK.
Figure 28
Adding in a column
15. Back in the Active Alerts view, scroll to the right if necessary and select the Last Modified column header to sort by that property. The reason why we are using this property instead of relying on the Created or Age column is that this exception may have occurred before. When repeat alerts are raised, the Repeat Count property is increased on the alert rather than creating a new one, and the Created property represents the timestamp of the first occurrence.
Figure 29
Sort by last modified time
16. Starting with the most recently modified alert, single-click on each warning alert until you locate the one that has a description describing the NullReferenceException that you just saw in the Fabrikam Fiber web application. The alert description is found in the Alert Details pane in the bottom part of the Active Alerts view.
Figure 30
Finding the alert associated with website error
17. Double-click on the alert to load the Alert Properties window. You can view all details related to the alert here. Note that the Repeat Count is greater than 0, meaning that it has occurred multiple times now.
Figure 31
Alert properties
18. In the lower portion of the Alert Properties window, change the Alert Status to be Assigned to Engineering and then select the Apply button. SCOM will then create a new Operational Issue work item in the team project specified by the template that we looked at earlier.
Figure 32
Assign an alert to engineering
19. Select the hyperlink that is in the Alert Description to view more information about the exception. It will take a few moments to load, and when Internet Explorer prompts you to allow a page to close, select the Yes button to continue.
Figure 33
Loading the AppDiagnostics web page for the alert
20. The Exception Event window shows an immense amount of data about the exception, the application, and the environment in which it was running. You can view all exception data and call stack, modules that were loaded, other events that may be related, and even performance counters that were collected. As you will see in a minute, all of this information is available to both operations and development.
Figure 34
Exception event information collected and recorded by SCOM
21. Close the Exception Event window and then close the Alert Properties window.
22. Minimize the Operations Console window. In the next step, we will transition to the development side.
23. Start Visual Studio from the taskbar.
Figure 35
Launching Visual Studio
24. In Team Explorer | Home, select the New Query link under Work Items.
Figure 36
Creating a new query
25. Change the Work Item Type field to be Operation Issue and the State field to be New.
Figure 37
Query definition to get new operational issues
26. Select the Run button to execute the query.
Figure 38
Executing the query
27. Double-click on the new Operation Issue work item to open it.