Eksporter (0) Skriv ut
Vis alt
EN
Dette innholdet er ikke tilgjengelig på ditt språk, men her er den engelske versjonen.
26 av 52 vurderte dette som nyttig - Vurder dette emnet

Diagnostics and Debugging in Windows Azure

Author: Trace Young

Debugging and Diagnostics is typically performed for Windows Azure hosts and Windows Azure applications by collecting diagnostic data and subsequently performing analysis of the collected data. This topic provides information describing the collection and analysis of diagnostic and debugging information for Windows Azure Host instances and Windows Azure applications.

Collecting Diagnostic and Debugging Data

The majority of debugging and diagnostics tasks performed for Windows Azure Applications or hosts depend upon diagnostic data that is collected by Windows Azure Diagnostics. As such, most debugging and diagnostics for Windows Azure Applications does not occur in real time, with the exception of debugging which can be performed locally when running Windows Azure Applications in Windows Azure Compute Emulator.

Windows Azure Diagnostics logs diagnostic data from various data sources. Certain data sources are logged by default when the Windows Azure Diagnostics Monitor is initialized. Windows Azure Diagnostics can also be configured to log data from other data sources. See How to Initialize the Windows Azure Diagnostic Monitor for information about initializing Windows Azure Diagnostics Monitor and configuring the diagnostics monitor to transfer diagnostic data to storage.

Windows Azure Diagnostics default data sources

Windows Azure Diagnostics logs data from the following sources by default:

  • Windows Azure logs – Windows Azure logs contain application specific diagnostic information from trace events when a Windows Azure application is configured with the appropriate trace listener and the Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener is added as a listener in the application’s app.config or web.config file.

  • IIS 7.0 logs – Provide a record of IIS requests handled by the IIS process.

    noteNote
    IIS 7.0 logs are not available in worker roles since worker roles are not configured with IIS.

  • Windows Azure Diagnostic infrastructure logs – Provide diagnostic data that is specific to Windows Azure such as Windows Azure Application deployment errors.

Windows Azure Diagnostics non Default Data Sources

Windows Azure Diagnostics can be configured to log data from the following data sources but does not log these by default:

  • IIS 7.0 Failed Request logs – Collecting data from IIS 7.0 failed request logs requires defining a Tracing element in the configuration file for web roles. For more information about configuring Windows Azure Diagnostics to collect IIS 7.0 failed request logs see How to Collect Data from IIS 7.0 Failed Request Trace Logs

  • Windows Event logs – Collecting Windows Event Logs with Windows Azure Diagnostics can be useful not only from the perspective of capturing the default Windows Event log entries but also for viewing application tracing information written to the Windows Event logs by Windows Azure Applications. For more information about using Windows Azure Diagnostics to log Windows Event log data see Collecting Event Logs in Windows Azure.

  • Performance counters – Windows Azure Diagnostics can be configured to log Performance counter data, including data from custom performance counters. For information about configuring Windows Azure Diagnostic to collect Performance counter data see How to Collect Data from Performance Counters. For information about instrumenting Windows Azure Application code with Performance counters see Instrumenting your Azure app with Performance Counters.

  • Crash dumps – Crash dumps contain a copy of the physical memory of an application or role instance that has failed or crashed for one reason or another. Windows Azure Diagnostics can be configured to capture the physical memory of a role instance and ADPlus can be used to capture a crash dump for a Windows Azure application.

    For information about configuring Windows Azure Diagnostics to capture a crash dump for a role instance see How to Collect Data from Crash Dumps.

    For information about using ADPlus to capture a crash dump for a Windows Azure application see Advanced Debugging on Windows Azure with ADPlus.

    Crash dumps can be copied from Windows Azure Storage to a local machine with debugging tools installed. Debugging tools such as Windbg can attach to the crash dump for debugging and analysis. For more information about debugging tools see Microsoft Debugging Tools.

  • Custom error logs - Custom error logs capture any files from any specified folder. The specified folders must be configured as local storage for your deployment. Custom error logs are uploaded to blob storage but when logging custom errors you must provide the container name. For more information about implementing custom error logs with Windows Azure Diagnostics see the blog post Custom Diagnostics in Windows Azure.

Ensuring that Diagnostic Data is Transferred to Windows Azure Storage

Windows Azure Diagnostics buffers logged data to a local storage resource and periodically transfers the data from the local storage resource to Windows Azure Storage. The frequency with which logged data is transferred from local storage to Windows Azure storage is defined by the DiagnosticDataBufferConfiguration.ScheduledTransferPeriod Property. The minimum interval that can be set for this property is 60 seconds. To ensure that logged data is transferred from local storage to Windows Azure Storage, do not specify a very large interval for the DiagnosticDataBufferConfiguration.ScheduledTransferPeriod Property, especially if the role instance or the Windows Azure application appear to be unstable. For more information about storing and viewing diagnostic data in Windows Azure Storage see Overview of Storing and Viewing Diagnostic Data in Windows Azure Storage. For more information about configuring local storage see How to Configure Local Storage Resources.

Windows Azure Diagnostics Resources

The following resources provide information for using Windows Azure Diagnostics.

  • Collecting Logging Data by Using Windows Azure Diagnostics - Provides links to several topics which describe considerations when collecting log data using Windows Azure Diagnostics.

  • Overview of Windows Azure Diagnostics - Provides an overview of Windows Azure Diagnostics including:

    • Important considerations for using Windows Azure Diagnostics

    • How to set up Windows Azure Diagnostics

    • Tracing the flow of Windows Azure Applications

    • Creating and using performance counters in a Windows Azure application

    • Storing and viewing diagnostic data in Windows Azure Storage

    • Managing the configuration of Windows Azure Diagnostics

  • How to: Store and View Diagnostic Data in Windows Azure Storage - Provides information for storing and viewing diagnostic data in Windows Azure Storage or the Windows Azure storage emulator.

  • Working with the Diagnostics Monitor - Walkthrough of code sample that illustrates the following:

    • How to start the Diagnostics Monitor

    • Provide data sources for the Diagnostics Monitor

    • Change a role’s diagnostics configuration at runtime for one or many instances of the role

    • Using the Azure Management Portal to change a role’s diagnostic configuration remotely

  • General Steps to investigate problems with Windows Azure Diagnostics – Provides steps to follow when Windows Azure Diagnostics is not working as expected.

  • Perform a customer query of diagnostics related questions posted to the Windows Azure Forums on MSDN – Modify the second parameter (diagnostics) embedded in the following URL to return variations:

    http://social.msdn.microsoft.com/Search/en-US/windowsazuresamples?query=%22Marked%20As%20Answer%22%20%22diagnostics%22&refinement=138&beta=0&ac=8

    The MSDN Forums may often provide late breaking information that is not yet published in official documentation, blog posts, or other sources.

    noteNote
    Check the date of any posts returned by this query to ensure that the subject matter is relevant to the version of the SDK that you are using.

Reading Diagnostic and Debugging Data

Captured diagnostic data is obviously of no use unless the data can be read and analyzed. Several tools exist for the purpose of reading Windows Azure Diagnostic data and other general purpose tools are available that can read and analyze Windows Azure Diagnostic data. This section describes several of these tools.

The following tools listed on the Deployment and Storage section of the Windows Azure Platform Tools web page are designed specifically for purposes of deployment and storage of Windows Azure Applications:

  • Windows Azure Platform Management Tool (MMC) - Enables you to manage your Windows Azure hosted services and storage accounts. This tool includes a diagnostics module which accommodates exporting logged data to Microsoft Excel for analysis.

  • Azure Storage Explorer - GUI tool for inspecting and altering the data in your Windows Azure Storage projects including the logs of your cloud-hosted applications.

  • DotNetNuke Azure Accelerator - Enables creation of new DotNetNuke host instances from on-premises to the cloud using a wizard to guide you through the process.

  • DeployToAzure - Allows automating deployment of a Windows Azure project and making it a part of TFS 2010 build process without using PowerShell or Azure Management CmdLets.

In addition to the tools above, the following tools are useful for reading and analyzing Windows Azure Diagnostic data:

  • Windows Azure PowerShell Cmdlets - Enables you to browse, configure, and manage Windows Azure Compute and Storage services directly from PowerShell. Provides cmdlets for use with Diagnostics including Get-DiagnosticAwareRoles, Get-DiagnosticAwareRoleInstances and Get-DiagnosticConfiguration.

  • Microsoft PowerPivot – Powerful tool that can be used to perform analysis of logged Windows Azure Diagnostics data.

Resources for Debugging Windows Azure Applications

The following resources provide information about debugging Windows Azure Applications:

  1. Debugging and Troubleshooting Windows Azure Applications - Describes some of the techniques specific to Windows Azure technology platform applications that will help you detect and resolve issues when building, deploying, and running Windows Azure applications.

  2. Debugging Windows Azure – Resources on the VM - Describes resources which are present on a VM that are useful for debugging Windows Azure applications.

  3. Debugging Windows Azure–Getting Tools onto the VM, Part 1 - Describes various methods for copying debugging tools to a Windows Azure VM.

  4. Debugging by Using Visual Studio - Describes methods that can be used to debug Windows Azure applications that are running in Window Azure Compute Emulator.

  5. Perform a customer query of debugging related questions posted to the Windows Azure Forums on MSDN – Modify the second parameter (debug) embedded in the following URL to return variations:

    http://social.msdn.microsoft.com/Search/en-US/windowsazuresamples?query=%22Marked%20As%20Answer%22%20%22debug%22&refinement=138&beta=0&ac=8

    The MSDN Forums may often provide late breaking information that is not yet published in official documentation, blog posts, or other sources.

    noteNote
    Check the date of any posts returned by this query to ensure that the subject matter is relevant to the version of the SDK that you are using.


Build Date:

2013-04-18
Vurderte du dette som nyttig?
(1500 tegn igjen)
Takk for tilbakemeldingen

Fellesskapsinnhold

Legg til
Vis:
© 2014 Microsoft. Med enerett.