debugging and troubleshooting azure applications using visual studio

26

Upload: chen

Post on 22-Feb-2016

99 views

Category:

Documents


0 download

DESCRIPTION

Debugging and troubleshooting Azure applications using Visual Studio. Boris Scholl Sr. Program Manager Visual Studio Azure Tools 3-547. Agenda. Overview Cloud Services Windows Azure Diagnostics IntelliTrace Profiling Windows Azure web sites Diagnostics Live Tracing - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio
Page 2: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Debugging and troubleshooting Azure applications using Visual StudioBoris SchollSr. Program Manager Visual Studio Azure Tools3-547

Page 3: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

OverviewCloud ServicesWindows Azure DiagnosticsIntelliTrace Profiling Windows Azure web sitesDiagnosticsLive TracingVisual Studio Developer DesktopSummary

Agenda

Page 4: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Environmental differences.What works in the Azure Emulator does not work in Azure.Performance issues.Site loads slowly. Computation takes a long time.Logical issues in code.My computation task returns a wrong result.

Common issues with Azure applications.

Overview

Page 5: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Collects the following diagnostics information.Windows event logs.Performance counters.Azure logs (trace logs, infrastructure logs).IIS logs (IIS logs, failed requests logs).Crash dumps.Custom logs.

What can I use Azure Diagnostics for?

Cloud Services – Windows Azure diagnostics

Page 6: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

How does it work in a developer scenario?

Cloud Services – Windows Azure diagnostics

Diagnostics.wadcfg

Azure BLOB stoarge

Azure Table Storage

Diagnostics Agent

Diagnostics.wadcfg

Diagnostics Agent

wad-control-container

Web/app.config

Web/app.config

IN_0

Page 7: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Diagnostics monitor precedence for configuration.BLOB storageCodeDiagnostics.wadcfgDefault config

What is the precedence of the configuration options?

Cloud Services – Windows Azure diagnostics

Page 8: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Keep in mind that there are two processes.

Note – Azure web role architecture

WaIIShost.exe

w3wp.exe

MvcWebRole1

MvcWebRole1.dll

MvcWebRole1.dll

*.cspack

MvcWebRole1.dll

MvcWebRole1.dll

Package

AppRoot

SiteRoot

Page 9: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Windows Azure Diagnostics in Visual Studio

Page 10: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Visual Studio includes the diagnostics agent by default.If the diagnostics connection string is not changed the diagnostics data will be stored in the storage account used for publishing.Failed requests need to be setup manually in web.config.Need to add config file for RoleEnvironment diagnostics.Redeploy required if changes are made to code or config.You can avoid a full redeploy by using RoleInstanceDiagnosticManager.Tracing strategy can be tested locally by using the storage emulator.

Azure diagnostics things to keep in mind!

Cloud Services – Windows Azure diagnostics

Page 11: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

A debugging experience allowing you to rewind/replay program execution

in the debugger.Captures WaIIShost.exe and w3wp.exe events.Great for chasing down logical errors.Great for detecting missing assemblies*.*We improved Visual Studio to detect missing assemblies during Build time. If missing assembly is detected we provide a Build warning.

What is IntelliTrace ?

Cloud Services – IntelliTrace (Visual Studio Ultimate)

Page 12: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Cloud Services – IntelliTrace

Visual Studio

Azure role instance

Azure storage = user storage account!

IntelliTrace agent

Create Agent Q

Polls queue every1 second

User requests logs

Create Q1 and place request in agent Q

GetLogs, Q1

Pending Create Snapshot

IntelliTrace.exe

*.itrace

Upload to BLOB

*.itraceUpload to Visual Studio

Page 13: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

IntelliTrace

Page 14: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Instrumentation Records how long every method takes to execute.Useful when the app is slow/blocked waiting for another operation (call another service, database call etc.)Impacts perf of application if many short running function.Can create gigs of log files in minutes.SamplingVery lightweight. Useful for identifying inefficient algorithms.

What does the profiler do?

Cloud Services – Profiler (Visual Studio Pro)

Page 15: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

TIP (Premium+ feature)Used in conjunction with instrumentation*.Records ADO.NET database queries.Resource contention data (concurrency)Detects threads waiting for other threads.Useful for detecting performance problems caused by lock contentions.

*Used to work with sampling on Windows 7

What does the profiler do?

Cloud Services – Profiler (Visual Studio Pro)

Page 16: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Profiler

Page 17: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Concurrency of agentsCLR agents cannot run concurrently.Polling intervalPolling interval can be changed. Add key <add key=" RequestPollInterval" value="00:00:10"/> to WindowsAzureDiagnosticsAgent.exe.config (C:\Program Files (x86)\Windows Azure Tools\Visual Studio 11.0\1.8\VsDiagnostics).

Things to keep in mind/tricks.

Cloud Services – IntelliTrace/profiler

Page 18: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Site diagnosticsDetailed error logging.Failed request tracing.Web server logging.Application diagnosticsProduced by the web application itself.Works similar to Cloud Service diagnostics.Use System.Diagnostics.Trace class. No configuration required.

Windows Azure web sites diagnostics options

Azure web site – Diagnostics

Page 19: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Diagnostics configurationLogging level• Informational• Warning• Error

File system• Stores data on web site file system• Can be accessed by FTP or downloaded

Storage• Stores data in Windows Azure storage account• In WAWSAppLogTable (similar schema as WADLogs)

Streaming logs• Live stream to PowerShell Window, Command Line or Visual Studio

Windows Azure web sites can be enabled from the portal and Visual Studio Server Explorer

Azure web site – Diagnostics

Page 20: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

How does it work ina developer scenario?

Web site diagnostics architecture

Azure Drive Trace Listener

Web App

Azure BLOB Azure Table Storage

Azure TableTrace Listener

Kudu Log streaming

Streamed Logs WebSite Drive

Page 21: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Windows Azure Web Sites Diagnostics

Page 22: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Developer desktop on Azure IaaSSupports SharePoint, Web and SQL development.• Visual Studio 2013 Ultimate Preview pre-installed.• SharePoint 2013 pre-installed.• SQL Server 2012 Express pre-installed.• Scripts to configure the environment included.

Great for spinning up dev environments quickly.Can be provisioned from portal or entirely through PowerShell with AD support.

I need to debug and troubleshoot an application and I need to set up an environment quickly.

Developer desktop preview in Azure

Page 24: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Device distribution starts after sessions conclude today (approximately 6:00pm) in the Big Room, Hall D. If you choose not to pick up your devices tonight, distribution will continue for the duration of the conference at Registration in the North Lobby.

Get your goodies

Acer Iconia W3, Surface Pro, and Surface Type Cover

Page 25: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

Evaluate this session

Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize!

Page 26: Debugging and  troubleshooting  Azure  applications  using  Visual  Studio

© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.