-
Notifications
You must be signed in to change notification settings - Fork 310
Refactor and remove azd-related implementation in deploy tools #1322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 |
tools/Azure.Mcp.Tools.Deploy/src/Services/Util/IaCRulesTemplateUtil.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
hemarina
left a comment
There was a problem hiding this 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."; |
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
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 => "", |
There was a problem hiding this comment.
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?
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
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationeng/scripts/Process-PackageReadMe.ps1. See Package README/servers/Azure.Mcp.Server/docs/azmcp-commands.mdand/or/docs/fabric-commands.md.\eng\scripts\Update-AzCommandsMetadata.ps1to update tool metadata in azmcp-commands.md (required for CI)ToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.json/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline