Skip to content

Conversation

@xfz11
Copy link
Member

@xfz11 xfz11 commented Dec 5, 2025

What does this PR do?

Refactor the implementation in deploy tools: refer to AZD MCP tools to get AZD-Bicep guidelines.

[Any additional context, screenshots, or information that helps reviewers]

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

@xfz11 xfz11 requested a review from qianwens as a code owner December 5, 2025 05:25
Copilot AI review requested due to automatic review settings December 5, 2025 05:25
@xfz11 xfz11 requested a review from a team as a code owner December 5, 2025 05:25
@xfz11 xfz11 requested a review from hallipr December 5, 2025 05:25
@github-project-automation github-project-automation bot moved this to Untriaged in Azure MCP Server Dec 5, 2025
Copilot finished reviewing on behalf of xfz11 December 5, 2025 05:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Deploy tools to remove embedded azd-related implementation details and delegates them to an external tool (#mcp_azure_mcp_azd). The changes simplify the codebase by removing template files and replacing them with tool invocation instructions.

  • Removed embedded azd-specific template files containing deployment steps, pipeline configurations, and IaC rules
  • Updated utility classes to use external tool calls instead of processing internal templates
  • Simplified code by inlining simple strings and delegating complex logic to external tools

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Deploy/src/Templates/Plan/azd-steps.md Deleted template file containing azd deployment and provisioning steps
tools/Azure.Mcp.Tools.Deploy/src/Templates/Pipeline/azd-pipeline.md Deleted template file for azd pipeline configuration instructions
tools/Azure.Mcp.Tools.Deploy/src/Templates/IaCRules/bicep-rules.md Deleted template file containing bicep-specific IaC generation rules
tools/Azure.Mcp.Tools.Deploy/src/Templates/IaCRules/azd-rules.md Deleted template file containing azd deployment tool rules
tools/Azure.Mcp.Tools.Deploy/src/Services/Util/PipelineGenerationUtil.cs Replaced template loading with inline string for azd pipeline configuration
tools/Azure.Mcp.Tools.Deploy/src/Services/Util/IaCRulesTemplateUtil.cs Refactored to call external tool for azd rules and return empty string for bicep rules
tools/Azure.Mcp.Tools.Deploy/src/Services/Util/DeploymentPlanTemplateUtil.cs Simplified azd steps generation to delegate to external tool

@xfz11 xfz11 changed the title remove azd-related implementation from deploy tools Refactor and remove azd-related implementation in deploy tools Dec 5, 2025
Copy link

@hemarina hemarina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for the refactoring! Having some small questions. I noticed we keep the architecture_diagram_generate as previous. Do we plan to replace it with azd's architecture_planning?

var steps = new List<string>();

var deployTitle = isAks ? "" : " And Deploy the Application";
var checkLog = isAks ? "" : "6. Check the application log with tool `azd-app-log-get` to ensure the services are running.";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask why we are removing check log part?


var azdSteps = TemplateService.ProcessTemplate("Plan/azd-steps", azdStepReplacements);
steps.Add(azdSteps);
steps.Add("Agent must call tool #mcp_azure_mcp_azd with input command='plan_init' to get instructions for AZD project initialization.");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we include 'discovery_analysis' and 'infrastructure_generation'?

discovery_analysis returns instructions for performing comprehensive discovery and analysis of application components to prepare for azd initialization.
infrastructure_generation returns instructions for generating modular Bicep infrastructure templates following Azure security and operational best practices for azd projects.

return parameters.IacType switch
{
IacType.Bicep => TemplateService.LoadTemplate("IaCRules/bicep-rules"),
IacType.Bicep => "",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the empty string here. Do we need to call any bicep generation tools like infrastructure_generation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants