Introducing the Cloud Debugger for Azure

The Cloud Debugger is an open-source tool for Azure developers to explore, learn, and troubleshoot their Azure cloud environments. Whether preparing for Azure certification, looking to streamline debugging, or aiming to deepen your understanding of Azure, Cloud Debugger provides the tools to make the cloud more discoverable.

Background

As I prepared for the AZ-204 Azure developer certification, I realized that I needed to build something larger to understand the Azure Cloud and the services covered by the Azure Developer certification. Just doing the included exercises was not enough. This led to me creating this open-source tool designed to help learn and simplify the debugging process for Azure applications.

The Mars Rover Analogy

When we explore Mars, we send rovers to measure, observe, and perform experiments to understand the unknown.

Similarly, developers need a systematic approach when navigating Azure, its vast and complex cloud territory! My tool is designed to do this; it enables you to explore, experiment, and measure your cloud more effectively.

Deploying a tool like Cloud Debugger allows us to explore, experiment, and learn about the cloud more effectively.

Teaching Tool

A secondary purpose of this tool is to serve as an exercise platform for future Azure training. Rather than relying solely on theoretical exercises, Cloud Debugger offers a hands-on environment where developers can actively engage with Azure services, troubleshoot real-world scenarios, and experiment with different configurations, features, and concepts.

What can the Cloud Debugger do?

The Cloud Debugger offers over 30 specialized tools to help developers explore, diagnose, and understand their Azure environment. These tools include:

  • HTTP Request tools
    • Current request viewer
      View details about the current request.
    • Request Logger
      Provides a list of all the received requests.
    • Calling External APIs
      Make HTTP requests to external APIs. Useful for testing external communication and tracing in Application Insights.
  • App Services
    • File System
      Explore the local file system.
    • Local Cache
      Explore the App Services local cache feature.
  • Storage tools
    • Blob Storage Tools
      Read and create blobs.
    • Create a user delegation SAS token
      Create a sample token to access a blob in blob storage.
    • File System Explorer
      Explore the local file system.
    • Redis Explorer
      Write and read keys from Redis.
    • Cosmos DB
      (coming soon)
  • Events and messaging
    • Event Grid
      Send events to Event Grid
    • Event Hubs
      Produce and consume Event Hub events
    • WebHooks
      Receive webhook requests from EventGrid and other services.
  • Identity tools
    • DefaultAzureCredentials
      Explore the inner workings of this TokenCredential.
    • Token caching
      Explore how the token caching varies across the different Token Credentials.
    • Token Credentials Explorer
      Explore the different Token Credentials.
    • Azure.Identity event log viewer
      Explore and view the internal event log.
  • Diagnostics and system information
    • Runtime Details
      Show details about the current runtime and operating system.
    • Environment Variables
      View all the environment variables.
    • Errors
      Trigger different error pages.
    • Network Details
      Show details about the network interfaces.
    • Scale-out and load balancing
      Visualize the effects of load-balancing
  • Logging
    • Logging
      Write a message to the standard log
    • Log Analytics Workspace
      Write messages to this service.
  • Other tools
    • Caching and CDN
      Explore the effect of caching and CDN.
    • Health checks

More tools will be added over time. If you have suggestions, feel free to contact the author, submit an issue, or contribute via a pull request.

Deploying Cloud Debugger

The Cloud Debugger is also designed to be highly flexible in its deployment options. The same service can be deployed across multiple environments using the provided PowerShell scripts, which makes it versatile for various use cases. It supports the following target environments:

  • Azure App Services
    • Windows
    • Linux
    • Linux Containers
  • Azure Container Instances
  • Azure Container Apps

This allows the service to be deployed across multiple environments, enabling comparisons of application behavior in each. One PowerShell script, BuildAndDeployAll.ps1, will build and deploy to all five environments in one operation.

Equally important is the DeleteAllResources.ps1 script, which will delete the Cloud Debugger resource group and its content. I typically run this script at the end of the day to save money and resources.

Implementation Details

The Debugger is implemented as a standard ASP.NET Core 8 application written in C#. A GitHub Action is triggered on every commit to ensure it builds as expected every time.
We pulled down the source code for these two projects below and then converted them into custom class libraries to make the insights and supported tools even better:

  • Azure Identity
    We patched this library to gain better insight into how the different Token Credentials behave internally. You can see this when you use the various Identity tools there.
  • Microsoft.AspNetCore.HttpLogging
    This class library has also been patched to log better the incoming requests made to this application.

Finally, we tweaked the namespaces of these two libraries to avoid collisions.

Secure development practices

We try to follow secure development practices, using tools that run with each pull request to prevent bugs, code smells, and security vulnerabilities from entering the cloud environment.

Here is what it can look like when a pull request does not pass all the checks:

Important Security Consideration

It is important not to run this tool in your production environment because it can expose internal secrets, keys, access tokens, and other sensitive information. The tool can also create or send content to various Azure services, which could lead to unintended changes or security risks if it is misused.

Crucially, you must lock down this tool to ensure that only authorized users can access it. Currently, the tool does not provide any built-in feature to restrict access, so additional security measures must be implemented separately.

Getting Started

The tool is now available on GitHub ; you can start using it by following the deployment guide.

The extensive documentation offers everything you need to get up and running quickly, focusing on providing the shortest path to value.

Join Us, Feedback and Contribute

Cloud Debugger is open source, and we welcome contributions! Whether you’re interested in adding new features, fixing bugs, or sharing your experiences with us and the community, we’d love to hear from you. Check out our GitHub repository  and join our growing community there.

About the author

Hi, I’m Tore! I have been fascinated by computers since I unpacked my first Commodore VIC-20. Today, I enjoy providing freelance development and developer training services, focusing on ASP.NET Core, IdentityServer, OpenID Connect, Architecture, and Web Security. You can connect with me on LinkedIn and Twitter, and you can find out more about me and my services here, as well as my courses for developers, including my course, Introduction to IdentityServer and OpenID-Connect.

Other Blog Posts by Me

Resources

Share This Story

Related Posts

About me

My name is Tore Nestenius and I’m a trainer and senior software developer focusing on Architecture, Security and Identity, .NET, C#, Backend, and Cloud, among other things.

Do You Want Tore To Be Your Mentor?

Categories