Microsoft has developed an open-source MCP server that enables GitHub Copilot to directly query Azure App Service logs, analyze errors, and debug issues through natural language conversation, significantly simplifying the troubleshooting process for developers.
Microsoft has introduced an innovative proof-of-concept MCP (Model Context Protocol) server that bridges the gap between developers and Azure App Service observability data. This open-source tool allows GitHub Copilot and other AI assistants to directly query App Service logs, analyze errors, and help debug issues—all through natural language conversation within familiar development environments like VS Code or CLI tools.
The traditional approach to debugging Azure App Services has been notoriously complex, requiring developers to navigate multiple log sources including Kudu container logs, Log Analytics tables (AppServiceHTTPLogs, ConsoleLogs, PlatformLogs, AppLogs), deployment logs, and metrics. This often involves opening the Azure Portal, determining which blade or log source contains the needed information, navigating to Log Analytics, remembering or searching for the correct KQL syntax, interpreting results, and manually correlating across multiple log tables—a process that can be time-consuming and frustrating, especially when troubleshooting under pressure.
The App Service Observability MCP Server transforms this experience by leveraging AI to understand natural language questions and translate them into precise API calls that fetch relevant data. For example, instead of manually constructing KQL queries to find why an application stopped working, developers can simply ask "Why did my app stop?" and receive immediate, actionable insights without leaving their IDE or terminal.
Key capabilities of this solution include:
- Comprehensive log querying from Log Analytics (HTTP logs, Console logs, Platform logs)
- Direct container log fetching from Kudu without additional setup
- HTTP error analysis grouped by status code and endpoint
- Identification of slow requests exceeding defined latency thresholds
- Deployment issue diagnosis with automatic correlation between deployments and startup failures
- Runtime-specific logging setup recommendations (Python, Node.js, .NET, Java)
- Deployment history viewing with issue correlation
- Container restart investigation with root cause identification
In a practical demonstration, the tool successfully identified a deployment issue where an application crashed due to a missing configuration file. GitHub Copilot, having access to both the App Service logs and the local codebase, was able to pinpoint the exact problem and suggest the necessary code fix. This dual-context awareness—combining observability data with code understanding—represents a significant advancement in developer productivity tools.
The MCP server operates as a middleware component between the AI assistant and Azure, translating natural language requests into precise API calls. Importantly, some tools like get_recent_logs and get_deployments work out of the box by calling Kudu and Azure Resource Manager (ARM) directly, while others require Log Analytics diagnostic settings to be enabled.
Security is handled through Azure SDK's DefaultAzureCredential, which leverages the developer's existing Azure identity from az login. This ensures the MCP server can only access resources the developer already has permission to access, with no stored secrets or elevated privileges. For production scenarios with autonomous agents, Microsoft recommends creating a dedicated service principal with least privileges to limit the blast radius and follow security best practices.
What sets this solution apart is not just the tooling but the inclusion of an Agent Skill file (SKILL.md) that provides GitHub Copilot with domain expertise specific to App Service debugging. This structured knowledge includes:
- Debugging workflows with step-by-step approaches for investigating issues
- Common error patterns (OOM crashes, Always On issues, HTTP 500/503 errors)
- KQL query templates ready for each scenario
- SKU references detailing which features are available on each pricing tier
- Best practices for presenting findings with actionable recommendations
The combination of MCP tools and domain expertise creates a powerful debugging assistant. When investigating a container stop, for example, the Agent Skill guides Copilot to check for OOM patterns in platform logs, differentiate between crash loops and graceful terminations, consider Always On settings based on the SKU, and provide the correct az command to fix the issue.
Getting started with this proof-of-concept requires Node.js 20+, Azure CLI for authentication, and VS Code with GitHub Copilot. The installation process involves cloning the repository, building the project, and configuring VS Code with a .vscode/mcp.json file specifying the Azure resource details.
Looking ahead, Microsoft is exploring how this pattern could become a first-class feature of the Azure App Service platform, potentially with a built-in MCP endpoint at https://my-app.scm.azurewebsites.net/mcp. Future developments will focus on team-wide deployment options, enabling entire development teams to leverage this tool for their workloads.
This innovation represents a significant step forward in cloud-native observability, demonstrating how AI can simplify complex debugging workflows while maintaining security and respect for existing access controls. By reducing the cognitive load associated with troubleshooting, developers can focus more on building and less on firefighting, potentially accelerating development cycles and improving application reliability.
The GitHub repository for this project is available at https://github.com/seligj95/app-service-observability-agent, where developers can explore the source code, contribute improvements, and provide feedback on additional tools or debugging patterns.

Comments
Please log in or register to join the discussion