This demo project showcases how to use azd app with AI-powered debugging through the MCP (Model Context Protocol) integration with GitHub Copilot, and demonstrates the unified testing framework.
📚 Full Documentation: jongio.github.io/azd-app
You'll need the Azure Developer CLI (azd) installed. Choose your platform:
Windows:
winget install microsoft.azdmacOS:
brew tap azure/azd && brew install azdLinux:
curl -fsSL https://aka.ms/install-azd.sh | bashInstall the azd app extension:
# Add extension source
azd extension source add -n jongio -t url -l https://jongio.github.io/azd-extensions/registry.json
# Install the extension
azd extension install jongio.azd.app# Install dependencies
azd app deps
# Start the API service
azd app run
# Run tests with coverage
azd app test --coverageThis demo showcases the azd app test command for unified test execution.
# Run all tests for all services
azd app test
# Run only unit tests
azd app test --type unit
# Run tests with coverage collection
azd app test --coverage
# Run tests with coverage threshold enforcement
azd app test --coverage --threshold 80
# Run tests for a specific service
azd app test --service api
# Verbose output showing test details
azd app test --verbose
# Dry run to see what would be tested
azd app test --dry-runThe azure.yaml file contains test configuration:
# Global test configuration
test:
parallel: true
outputDir: ./test-results
coverage:
enabled: true
threshold: 70
services:
api:
test:
unit:
command: npm test
integration:
command: npm run test:integration
coverage:
threshold: 80The demo includes a test file (api/server.test.js) that:
- Tests all CRUD operations (GET, POST, DELETE)
- Validates input handling
- Tests error cases (404, 400 responses)
- Includes proper validation (demonstrating what the "bug" should have)
When running with --coverage, reports are generated in:
./test-results/- Aggregated coverage reports./api/coverage/- Service-specific coverage
This project includes an intentional bug for demonstrating AI debugging capabilities.
The API's /items endpoint doesn't validate the price field. When you POST an item without a price, the tax calculation fails:
# This works correctly
curl -X POST http://localhost:3000/items -H "Content-Type: application/json" -d '{"name": "Widget", "price": 10}'
# This triggers the bug (missing price)
curl -X POST http://localhost:3000/items -H "Content-Type: application/json" -d '{"name": "Broken Widget"}'-
Run the service with
azd app run -
Trigger the bug with the curl command above
-
Open GitHub Copilot Chat (Ctrl+Shift+I on Windows/Linux or Cmd+Shift+I on macOS) and ask:
"Check the API logs for errors"
Copilot uses the MCP tools to call
get_service_logsand shows you the error. -
Ask Copilot:
"Why is the total calculation failing?"
Copilot analyzes the logs and code to identify the missing validation.
-
Ask Copilot:
"Fix the price validation bug"
Copilot suggests adding input validation for the price field.
The .vscode/mcp.json file configures the azd app MCP server for Copilot:
{
"servers": {
"Azure Developer CLI - App Extension": {
"command": "azd",
"args": ["app", "mcp", "serve"]
}
}
}When debugging with Copilot, 10 tools are available across three categories:
| Tool | Description |
|---|---|
get_services |
List all services with status, ports, and health |
get_service_logs |
Fetch logs with optional filtering by level and time |
get_project_info |
Get azure.yaml configuration |
| Tool | Description |
|---|---|
run_services |
Start all or specific services |
stop_services |
Stop all or specific services |
restart_service |
Restart a specific service |
install_dependencies |
Install dependencies for services |
| Tool | Description |
|---|---|
check_requirements |
Verify prerequisites (Node.js, Python, etc.) |
get_environment_variables |
Get environment variables (sensitive values redacted) |
set_environment_variable |
Set an environment variable for a service |
See the full MCP Tools Reference for detailed documentation.
demo/
├── azure.yaml # Service and test configuration
├── test-results/ # Aggregated test/coverage reports (generated)
├── .vscode/
│ └── mcp.json # MCP server configuration
├── api/
│ ├── package.json # Node.js dependencies and test scripts
│ ├── server.js # API with intentional bug
│ ├── server.test.js # Unit tests for the API
│ └── coverage/ # Service coverage reports (generated)
└── README.md # This file
| Method | Path | Description |
|---|---|---|
| GET | /items | List all items |
| POST | /items | Create item (bug: no price validation) |
| GET | /items/:id | Get item by ID |
| DELETE | /items/:id | Delete item |
| Command | Description |
|---|---|
azd app deps |
Install dependencies for all services |
azd app run |
Start all services |
azd app stop |
Stop all services |
azd app test |
Run tests for all services |
azd app test --coverage |
Run tests with coverage collection |
azd app test --type unit |
Run only unit tests |
azd app logs |
View service logs |