Remove hardcoded Azure Functions templates, use MCP tool - #1902
Remove hardcoded Azure Functions templates, use MCP tool#1902Manvir Kaur (manvkaur) wants to merge 6 commits into
Conversation
Replace ~70 hardcoded template files (source code, Bicep, Terraform) with dynamic MCP tool calls via functions_template_get(). Templates are now retrieved at runtime from Azure Functions CDN. Changes: - Remove source/<lang>.md files (6 langs x 8 recipes = ~48 files) - Remove bicep/*.bicep and terraform/*.tf files (~20 files) - Remove common/uami-bindings.md (guidance now in composition.md) - Update composition.md with UAMI validation, entry point rules, deploy strategy - Update recipe READMEs with troubleshooting sections - Update eval summaries to reflect MCP tool validation - Simplify recipes/README.md to reference selection.md Tested: - HTTP trigger: PASS (5 API calls, 54s) - Timer trigger: PASS (12 API calls, 146s) - Cosmos DB trigger: PASS (5 API calls, 49s) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the azure-prepare skill’s Azure Functions guidance to stop relying on hardcoded, in-repo “template” snippets and instead direct users to discover and fetch templates dynamically via the functions_template_get MCP tool (or a CDN manifest fallback).
Changes:
- Removes many legacy per-language “template/source” and IaC snippet files under Functions recipes (timer/sql/servicebus/eventhubs/durable/cosmosdb/blob-eventgrid/mcp).
- Updates recipe READMEs and eval summaries to reference MCP-based template discovery (
resourcefiltering) instead of local template files. - Bumps
plugin/skills/azure-prepareskill version from 1.1.12 → 1.1.13.
Reviewed changes
Copilot reviewed 94 out of 94 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/skills/azure-prepare/references/services/functions/triggers.md | Removed legacy trigger examples doc. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/source/typescript.md | Removed hardcoded Timer TS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/source/python.md | Removed hardcoded Timer Python source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/source/powershell.md | Removed hardcoded Timer PowerShell source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/source/javascript.md | Removed hardcoded Timer JS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/source/java.md | Removed hardcoded Timer Java source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/source/dotnet.md | Removed hardcoded Timer .NET source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/eval/summary.md | Updated eval summary to MCP-template framing. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/README.md | Updated Timer recipe to MCP resource discovery approach. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/terraform/sql.tf | Removed hardcoded SQL Terraform module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/source/typescript.md | Removed hardcoded SQL TS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/source/python.md | Removed hardcoded SQL Python source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/source/powershell.md | Removed hardcoded SQL PowerShell source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/source/javascript.md | Removed hardcoded SQL JS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/source/java.md | Removed hardcoded SQL Java source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/source/dotnet.md | Removed hardcoded SQL .NET source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/eval/summary.md | Updated eval summary to MCP-template framing. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/eval/python.md | Updated Python eval doc to MCP discovery/selection workflow. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/bicep/sql.bicep | Removed hardcoded SQL Bicep module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/README.md | Updated SQL recipe to MCP resource discovery approach. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/terraform/servicebus.tf | Removed hardcoded Service Bus Terraform module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/source/typescript.md | Removed hardcoded Service Bus TS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/source/python.md | Removed hardcoded Service Bus Python source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/source/powershell.md | Removed hardcoded Service Bus PowerShell source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/source/javascript.md | Removed hardcoded Service Bus JS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/source/java.md | Removed hardcoded Service Bus Java source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/source/dotnet.md | Removed hardcoded Service Bus .NET source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/eval/summary.md | Updated eval summary to MCP-template framing. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/bicep/servicebus.bicep | Removed hardcoded Service Bus Bicep module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/README.md | Updated Service Bus recipe to MCP resource discovery approach + troubleshooting. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/mcp/source/typescript.md | Removed hardcoded MCP TS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/mcp/source/python.md | Removed hardcoded MCP Python source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/mcp/source/powershell.md | Removed hardcoded MCP PowerShell source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/mcp/source/javascript.md | Removed hardcoded MCP JS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/mcp/source/java.md | Removed hardcoded MCP Java source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/mcp/source/dotnet.md | Removed hardcoded MCP .NET source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/mcp/eval/summary.md | Updated eval summary to MCP-template framing. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/mcp/README.md | Updated MCP recipe to MCP resource discovery approach. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/source/typescript.md | Removed hardcoded Event Hubs TS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/source/python.md | Removed hardcoded Event Hubs Python source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/source/powershell.md | Removed hardcoded Event Hubs PowerShell source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/source/javascript.md | Removed hardcoded Event Hubs JS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/source/java.md | Removed hardcoded Event Hubs Java source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/source/dotnet.md | Removed hardcoded Event Hubs .NET source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/eval/summary.md | Updated eval summary to MCP-template framing. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/eval/python.md | Updated Python eval doc to MCP discovery/selection workflow. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/bicep/eventhubs.bicep | Removed hardcoded Event Hubs Bicep module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/bicep/eventhubs-network.bicep | Removed hardcoded Event Hubs networking Bicep module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/README.md | Updated Event Hubs recipe to MCP resource discovery approach. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/source/typescript.md | Removed hardcoded Durable TS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/source/python.md | Removed hardcoded Durable Python source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/source/powershell.md | Removed hardcoded Durable PowerShell source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/source/javascript.md | Removed hardcoded Durable JS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/source/java.md | Removed hardcoded Durable Java source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/source/dotnet.md | Removed hardcoded Durable .NET source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/eval/summary.md | Updated eval summary to MCP-template framing (+ DTS note/link). |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/eval/python.md | Updated Python eval doc to MCP discovery/selection workflow. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/bicep/durable-task-scheduler.bicep | Removed hardcoded Durable Task Scheduler Bicep module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/source/typescript.md | Removed hardcoded Cosmos DB TS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/source/python.md | Removed hardcoded Cosmos DB Python source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/source/powershell.md | Removed hardcoded Cosmos DB PowerShell source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/source/javascript.md | Removed hardcoded Cosmos DB JS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/source/java.md | Removed hardcoded Cosmos DB Java source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/source/dotnet.md | Removed hardcoded Cosmos DB .NET source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/eval/summary.md | Updated eval summary to MCP-template framing. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/eval/python.md | Updated Python eval doc to MCP discovery/selection workflow. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/bicep/cosmos.bicep | Removed hardcoded Cosmos DB Bicep module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/bicep/cosmos-network.bicep | Removed hardcoded Cosmos DB networking Bicep module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/common/uami-bindings.md | Removed legacy UAMI binding guidance doc (now presumed covered by templates). |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/terraform/blob.tf | Removed hardcoded blob+EventGrid Terraform module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/source/typescript.md | Removed hardcoded blob+EventGrid TS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/source/python.md | Removed hardcoded blob+EventGrid Python source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/source/powershell.md | Removed hardcoded blob+EventGrid PowerShell source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/source/javascript.md | Removed hardcoded blob+EventGrid JS source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/source/java.md | Removed hardcoded blob+EventGrid Java source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/source/dotnet.md | Removed hardcoded blob+EventGrid .NET source template. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/eval/summary.md | Updated eval summary to MCP-template framing. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/eval/python.md | Updated Python eval doc to MCP discovery/selection workflow. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/bicep/blob.bicep | Removed hardcoded blob+EventGrid Bicep module. |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/README.md | Updated blob+EventGrid recipe to MCP resource discovery approach. |
| plugin/skills/azure-prepare/references/services/functions/templates/mcp.md | Removed legacy MCP templates index doc. |
| plugin/skills/azure-prepare/references/services/functions/templates/integrations.md | Removed legacy integrations index doc. |
| plugin/skills/azure-prepare/references/services/functions/templates/http.md | Removed legacy HTTP templates index doc. |
| plugin/skills/azure-prepare/references/services/functions/templates/base/eval/summary.md | Updated base HTTP eval summary to MCP-template framing. |
| plugin/skills/azure-prepare/references/services/functions/durable.md | Updated Durable Functions guidance to point to MCP templates workflow. |
| plugin/skills/azure-prepare/SKILL.md | Version bump to reflect skill documentation changes. |
- Remove deleted triggers.md link from functions/README.md - Fix directory links to point to README.md files in recipes/README.md - Fix directory links to point to README.md files in selection.md - Fix durable-task-scheduler relative path (add extra ../ level) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix relative link to durable-task-scheduler (4 levels up to services/) - Remove stray backticks breaking table in durable/README.md - Remove test and migration-plan files from PR (keep local) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- templates/README.md: add links to recipes/README.md and base/eval/summary.md - recipes/README.md: add link to common/error-handling.md - base/eval/summary.md: add link to python.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Jon Gallant (jongio)
left a comment
There was a problem hiding this comment.
Direction looks right. A few concrete items to look at before this comes out of draft:
Blocking: Skill Structure CI is failing. azure-prepare bumped 1.1.15 → 1.1.16 in this PR, but main has moved to 1.1.18 since you branched. The check compares base vs. head, so it needs a bump to at least 1.1.19 after you merge/rebase main.
Tool signature drift. The prescriptive docs (templates/README.md, selection.md, composition.md) all show functions_template_get(language: "python") - keyword args. But the five recipes/*/eval/python.md files show a positional form in their "Template discovery" row: functions_template_get("python"). If the MCP server rejects positional args, agents copying the eval form will fail. Pick one and standardize.
Example: recipes/blob-eventgrid/eval/python.md line 7 has functions_template_get("python") while line 16 (same file) uses the keyword form. Same pattern in cosmosdb, durable, eventhubs, sql.
Fallback has no manifest-failure path. templates/README.md Step 1 (line 115) and composition.md Step 1 (line 45) both unconditionally GET cdn.functions.azure.com/.../manifest.json. There's a fallback for per-template download failures ("fall back to git clone"), but nothing for manifest.json itself being 404/timeout/DNS-failed. Agent will stall or surface a confusing error. Suggest: if manifest fetch fails, fall back to a known-good list of Azure-Samples/functions-quickstart-* repos keyed by language+resource, or at minimum document "report and ask user to retry later".
Duplicate intent→resource table. templates/README.md Step 2 (lines 41-51) and selection.md (lines 9-20) now both carry the user-intent → resource-filter mapping. They already disagree subtly: README has "MCP, server, tools, resource, prompt" and "AI agent, chatbot" rows that selection.md doesn't, and the "Service Bus" row reads differently in each. Two sources of truth on the same mapping will drift. Consolidate: keep the table in selection.md (since it's the selection guide) and have templates/README.md Step 2 reference it.
Line 47 of templates/README.md reads rough. | "Service Bus, Message processing topic, queue| "Service Bus" | servicebus | - the "Message processing topic, queue" phrasing is ambiguous and the cell delimiter is missing a space. Something like Service Bus, message queue, topic, pub-sub is clearer.
Eval summaries don't back up the "✅ PASS" claims. kvenkatrajan already asked for test results. The eval/summary.md files (all of them) report PASS for MCP Tool Validation but carry no attached azd up output, generated project listing, or verification logs. For Python (the only language currently marked complete), attaching one concrete run would give reviewers something real to look at. Agreed with the ask.
Copilot bot's link feedback on durable/README.md:14 and durable/eval/summary.md:35 - those links actually resolve correctly. ../../../../durable-task-scheduler/README.md from recipes/durable/README.md and ../../../../../durable-task-scheduler/README.md from eval/summary.md both resolve to services/durable-task-scheduler/README.md, which exists. Safe to resolve those threads.
Main risk I see: eval coverage gap. Six languages claimed, only Python actually verified. Worth tracking in the PR description or a follow-up issue so this doesn't ship as "done" while five languages are still pending.
|
Closing in favor of a new PR #1949 from the microsoft org branch (commits were pushed directly to microsoft/GitHub-Copilot-for-Azure). |
Description
Replace ~70 hardcoded Azure Functions template files with dynamic MCP tool calls (
functions_template_get). This reduces context and maintenance burden by fetching templates from GitHub samples at runtime instead of storing static copies.Summary
Key Changes
functions_template_get(language, template)MCP toolIntegration Test Results ✅
CI Run: Integration Tests - azure-prepare (passed)
Functions Template MCP Validation (11 tests)
Manifest-Backed Language Coverage
Eval summaries now reference the functions template manifest (70 templates, 6 languages) instead of claiming unverified coverage. Python is verified end-to-end; other languages are confirmed as AZD templates in the manifest.
📋 = AZD template exists in manifest (number = template count) | 🔧 agent = No AZD template, skill relies on agent-composed scaffolding
AZD Template Gaps
cc Paul Yuknewicz (@paulyuk)
PR Review Items Addressed
Checklist
cd tests && npm test)USE FOR/DO NOT USE FOR/PREFER OVERclauses: confirmed no routing regressions - N/ARelated Issues