Learn the various ways to debug an Azure cloud service

Note

This article applies to Azure Cloud Services (classic), which is now deprecated for new customers and will be retired on August 31, 2024. Existing services built with this technology are still supported through Azure Cloud Services (extended support). For new development, we recommend that you use a newer service type designed for your specific purpose, such as Azure App Service, Azure Functions, or Azure Container Apps. For the latest list of available services, see Directory of Azure products.

This article provides links to the various ways to debug an Azure cloud service.

Debugging an Azure cloud service in Visual Studio

You can save time and money by using the Azure Compute Emulator to debug your cloud service on a local machine. By debugging a service locally before you deploy it, you can improve reliability and performance without paying for compute time. However, some errors might occur only when you run a cloud service in Azure. Errors that occur only when you run a cloud service in Azure can be debugged by enabling remote debugging when you publish your service, and then attaching the debugger to a role instance. For more information, see Debug your cloud service on your local computer.

Using IntelliTrace

If you are using Visual Studio Enterprise to write roles targeted .NET Framework 4.5, you can enable IntelliTrace at the time that you deploy an Azure cloud service from Visual Studio. IntelliTrace provides a log that you can use with Visual Studio to debug your application as if it were running in Azure. For more information, see Debugging a published cloud service with IntelliTrace and Visual Studio.

Remote debugging

You can enable remote debugging on your cloud services at the time when you deploy the cloud service from Visual Studio. If you choose to enable remote debugging for a deployment, remote debugging services are installed on the virtual machines that run each role instance. These services - such as msvsmon.exe - do not affect performance or result in extra costs. For more information, see Debug a cloud service in Azure.