microsoft / microsoft/GitHub-Copilot-for-Azure

Enhancement: Replace hardcoded Container Apps templates with MCP tool (apply #1949 pattern)

Open
#2,149 2 comments 0 reactions 1 assignee Claimed by @paulyuk View on GitHub
Dominant language
Python
Stars
250
Forks
204
Avg merge
1d 12h
Merged PRs (30d)
67

Description

**DRIs:** @paulyuk (assignee), @simonjj (co-DRI — see comment, external contributor)

---

## Context

@manvkaur's [PR #1949](https://github.com/microsoft/GitHub-Copilot-for-Azure/pull/1949) replaced ~9,000 lines of hardcoded Azure Functions templates with dynamic MCP tool calls (`functions_template_get`), with a 3-tier fallback (CDN manifest → GitHub source → known-good Azure-Samples repos). This dramatically reduced context size and maintenance burden.

Container Apps should adopt the same pattern.

## Scope

The Container Apps templates introduced in #1610 / [PR #1636](https://github.com/microsoft/GitHub-Copilot-for-Azure/pull/1636) currently hard-code:

- **15 files** under `plugin/skills/azure-prepare/references/services/container-apps/templates/`
- **~2,033 lines** covering 6 base templates (web-app, api, microservice, worker, job, functions-on-aca) and 7 recipes (acr, cosmos, dapr, postgres, redis, servicebus, composition)

These could be replaced with an analogous `container_apps_template_get` (or similar) MCP tool that fetches templates dynamically from [Azure-Samples](https://github.com/Azure-Samples) repos.

## Proposed approach

1. **Source of truth** — identify or create AZD templates in Azure-Samples for each base template × recipe combination (Container Apps already has rich AZD templates: [container-apps-azd-templates](https://github.com/Azure-Samples?q=container-apps))
2. **MCP tool** — extend the Azure MCP server with `container_apps_template_get` mirroring `functions_template_get` semantics
3. **Fallback chain** — same 3-tier pattern: CDN manifest → GitHub source → known-good repos
4. **Skill refactor** — delete hardcoded base template files; keep orchestration (composition.md, selection.md, recipes/README.md) with MCP tool guidance like Functions
5. **Recipe-specific work** — Container Apps recipes (Dapr components, KEDA scalers) are more layered than Functions bindings. Keep recipe READMEs that document the additive overlays; let the MCP tool deliver the base + Dapr/KEDA wiring patterns
6. **Eval coverage** — add cross-language eval summaries proving end-to-end deployment

## Why this isn't blocking PR #1636

PR #1636 ships proven, manually-curated templates that work today. The MCP tool approach requires:
- New MCP server endpoint
- AZD template inventory mapped to base+recipe combinations
- Cross-team coordination

We don't want to delay shipping Container Apps Develop equity for an optimization. Ship #1636 first, then layer this enhancement on top.

## Reference
- PR #1949: https://github.com/microsoft/GitHub-Copilot-for-Azure/pull/1949
- Functions composition.md (post-MCP): `plugin/skills/azure-prepare/references/services/functions/templates/recipes/composition.md`
- Parent equity issue: #1608
- Source PR for Container Apps templates: #1636

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.