Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e126498
deploy_iac_get
hemarina Nov 5, 2025
4c8e800
deploy_pipeline
hemarina Nov 6, 2025
5da3f19
deploy_architecture
hemarina Nov 6, 2025
ec1a3c6
deploy_plan_get
hemarina Nov 6, 2025
ba6ae2b
deploy_app_log_gets
hemarina Nov 7, 2025
bd12c9f
rename
hemarina Nov 7, 2025
6633727
revert deployment.md as suggested on comments
hemarina Nov 7, 2025
6203931
update tests
hemarina Nov 10, 2025
8721bd0
follow contributing guide and PR requirements
hemarina Nov 13, 2025
71cd4cb
Update tools/Azure.Mcp.Tools.Deploy/src/Services/Util/ResourceLogServ…
hemarina Nov 13, 2025
07971f0
Update servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
hemarina Nov 13, 2025
2324a57
Update tools/Azure.Mcp.Tools.Deploy/src/Commands/App/LogsGetCommand.cs
hemarina Nov 13, 2025
9113b44
Update tools/Azure.Mcp.Tools.Deploy/src/DeploySetup.cs
hemarina Nov 13, 2025
51b4c73
Update tools/Azure.Mcp.Tools.Deploy/src/Commands/Infrastructure/Rules…
hemarina Nov 13, 2025
98dfa51
Update eng/tools/ToolDescriptionEvaluator/tools.json
hemarina Nov 13, 2025
a75a03f
Update tools/Azure.Mcp.Tools.Deploy/src/Options/App/LogsGetOptions.cs
hemarina Nov 13, 2025
40d93e9
Rerun ToolDescriptionEvaluator
hemarina Nov 13, 2025
26d0453
address copilot suggestion
hemarina Nov 13, 2025
ed00e4f
remove deployment tool line for live test as no longer needed
hemarina Nov 13, 2025
647011c
address comment, add iac rules
hemarina Nov 24, 2025
462a735
remove mcp
hemarina Nov 24, 2025
7db834f
remove azd related md
hemarina Nov 25, 2025
c004c28
Merge branch 'main' of https://github.com/microsoft/mcp into dep-azd
hemarina Nov 25, 2025
7d63769
Run ToolDescriptionEvaluator
hemarina Nov 25, 2025
90a3a82
fix pipeline test missing parameters
hemarina Nov 25, 2025
bae137c
fix live test
hemarina Nov 25, 2025
57dd986
fix tests based on az-cli rules
hemarina Nov 25, 2025
0c673f1
Merge branch 'main' of https://github.com/microsoft/mcp into dep-azd
hemarina Nov 25, 2025
2cff097
fix analyze bug by running azuremcp.sln
hemarina Nov 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions docs/bug-bash/scenarios/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

- [ ] Azure MCP Server installed and configured
- [ ] Azure CLI installed (`az --version`)
- [ ] Azure Developer CLI installed (`azd version`)
- [ ] Authenticated to Azure (`az login`)
- [ ] Active Azure subscription
- [ ] GitHub Copilot with Agent mode enabled
Expand Down Expand Up @@ -69,7 +68,7 @@ I have a Node.js Express application in folder 'bugbash-deploy-app'. Create a de
- [ ] Tool invoked: `azmcp_deploy_plan_get`
- [ ] Deployment plan includes App Service target
- [ ] Runtime configuration identified (Node.js)
- [ ] Provisioning tool recommendation provided (Bicep, Terraform, or azd)
- [ ] Provisioning tool recommendation provided (Bicep, Terraform)
- [ ] Project structure analysis included

**2.2 Alternative phrasing**:
Expand Down Expand Up @@ -101,9 +100,9 @@ Generate GitHub Actions workflow guidance for deploying my Node.js app to Azure
- [ ] Approval workflows mentioned
- [ ] Environment-specific configuration guidance provided

### Step 4: Deploy Application (Azure CLI/azd - Not MCP)
### Step 4: Deploy Application (Azure CLI - Not MCP)

> **External Deployment Required**: Use Azure CLI or azd to deploy
> **External Deployment Required**: Use Azure CLI to deploy

```bash
# Create resource group
Expand Down Expand Up @@ -357,7 +356,7 @@ az group delete --name bugbash-fullstack-rg --yes --no-wait
| **Project Not Recognized** | MCP can't identify project type | Ensure package.json or project files exist in the folder |
| **Missing Dependencies** | Required project files missing | Check project structure has all necessary configuration files |
| **IaC Tool Mismatch** | Wrong provisioning tool recommended | Specify preferred tool (Bicep/Terraform) in the prompt |
| **Log Retrieval Fails** | Can't access application logs | Verify azd environment exists and is properly configured |
| **Log Retrieval Fails** | Can't access application logs | Verify resource group is provided |
| **Architecture Diagram Errors** | Diagram generation fails | Ensure application topology is properly defined |
| **Pipeline Guidance Generic** | Recommendations too generic | Provide more context about your project structure and requirements |

Expand All @@ -375,7 +374,6 @@ When logging issues, include:
## 📚 Related Resources

- [Azure Deployment Center](https://learn.microsoft.com/azure/app-service/deploy-continuous-deployment)
- [Azure Developer CLI (azd)](https://learn.microsoft.com/azure/developer/azure-developer-cli/)
- [GitHub Actions for Azure](https://learn.microsoft.com/azure/developer/github/github-actions)
- [Azure DevOps Pipelines](https://learn.microsoft.com/azure/devops/pipelines/)
- [MCP Command Reference](https://github.com/microsoft/mcp/blob/main/servers/Azure.Mcp.Server/docs/azmcp-commands.md)
Expand All @@ -393,7 +391,7 @@ When logging issues, include:
- `azmcp_deploy_pipeline_guidance_get` - Get CI/CD pipeline setup guidance

### Application Logs
- `azmcp_deploy_app_logs_get` - Get application service logs for azd environment
- `azmcp_deploy_app_logs_get` - Get application service logs for resource group

---

Expand Down
2 changes: 1 addition & 1 deletion eng/tools/ToolDescriptionEvaluator/namespace-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
{
"name": "deploy",
"description": "Deploy commands for deploying applications to Azure, including sub commands: - plan get: generates a deployment plan to construct the infrastructure and deploy the application on Azure. Agent should read its output and generate a deploy plan in '.azure/plan.copilotmd' for execution steps, recommended azure services based on the information agent detected from project. Before calling this tool, please scan this workspace to detect the services to deploy and their dependent services; - iac rules get: offers guidelines for creating Bicep/Terraform files to deploy applications on Azure; - app logs get: fetch logs from log analytics workspace for Container Apps, App Services, function apps that were deployed through azd; - pipeline guidance get: guidance to create a CI/CD pipeline which provision Azure resources and build and deploy applications to Azure; - architecture diagram generate: generates an azure service architecture diagram for the application based on the provided app topology; ",
"description": "Deploy commands for deploying applications to Azure, including sub commands: - plan get: generates a deployment plan to construct the infrastructure and deploy the application on Azure. Agent should read its output and generate a deploy plan in 'docs/plan.copilotmd' for execution steps, recommended azure services based on the information agent detected from project. Before calling this tool, please scan this workspace to detect the services to deploy and their dependent services; - iac rules get: offers guidelines for creating Bicep/Terraform files to deploy applications on Azure; - app logs get: fetch logs from log analytics workspace for Container Apps, App Services, function apps that were deployed through az cli; - pipeline guidance get: guidance to create a CI/CD pipeline which provision Azure resources and build and deploy applications to Azure; - architecture diagram generate: generates an azure service architecture diagram for the application based on the provided app topology; ",
"command": "azmcp deploy"
},
{
Expand Down
38 changes: 7 additions & 31 deletions eng/tools/ToolDescriptionEvaluator/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@
},
{
"name": "get",
"description": "Shows application logs specifically for Azure Developer CLI (azd) deployed applications from their associated Log Analytics workspace for Container Apps, App Services, and Function Apps. Designed exclusively for applications deployed via 'azd up' command and automatically discovers the correct workspace and resources based on the azd environment configuration. Use this tool to check deployment status or troubleshoot post-deployment issues.",
"description": "Shows application logs for deployed applications from their associated Log Analytics workspace for Container Apps, App Services, and Function Apps. Discovers the correct workspace and resources based on the resource group name. Use this tool to check deployment status or troubleshoot post-deployment issues.",
"command": "deploy app logs get",
"option": [
{
Expand Down Expand Up @@ -1759,14 +1759,14 @@
"required": null
},
{
"name": "--workspace-folder",
"description": "The full path of the workspace folder.",
"name": "--resource-group",
"description": "Specifies the Azure resource group to use. Accepts either a resource group name or ID.",
"type": "string",
"required": true
},
{
"name": "--azd-env-name",
"description": "The name of the environment created by azd (AZURE_ENV_NAME) during `azd init` or `azd up`. If not provided in context, try to find it in the .azure directory in the workspace or use 'azd env list'.",
"name": "--workspace-folder",
"description": "The full path of the workspace folder.",
"type": "string",
"required": true
},
Expand All @@ -1793,15 +1793,9 @@
},
{
"name": "get",
"description": "This tool offers guidelines for creating Bicep/Terraform files to deploy applications on Azure. The guidelines outline rules to improve the quality of Infrastructure as Code files, ensuring they are compatible with the azd tool and adhere to best practices.",
"description": "This tool offers guidelines for creating Bicep/Terraform files to deploy applications on Azure. The guidelines outline rules to improve the quality of Infrastructure as Code files and adhere to best practices.",
"command": "deploy iac rules get",
"option": [
{
"name": "--deployment-tool",
"description": "The deployment tool to use. Valid values: AZD, AzCli",
"type": "string",
"required": true
},
{
"name": "--iac-type",
"description": "The Infrastructure as Code type. Valid values: bicep, terraform. Leave empty if deployment-tool is AzCli.",
Expand Down Expand Up @@ -1869,12 +1863,6 @@
"type": "string",
"required": null
},
{
"name": "--use-azd-pipeline-config",
"description": "Whether to use azd tool to set up the deployment pipeline. Set to true ONLY if azure.yaml is provided or the context suggests AZD tools.",
"type": "string",
"required": null
},
{
"name": "--organization-name",
"description": "The name of the organization or the user account name of the current Github repository. DO NOT fill this in if you're not sure.",
Expand All @@ -1897,7 +1885,7 @@
},
{
"name": "get",
"description": "Generates a deployment plan to construct the infrastructure and deploy the application on Azure. Agent should read its output and generate a deploy plan in '.azure/plan.copilotmd' for execution steps, recommended azure services based on the information agent detected from project. Before calling this tool, please scan this workspace to detect the services to deploy and their dependent services.",
"description": "Generates a deployment plan to construct the infrastructure and deploy the application on Azure. Agent should read its output and generate a deploy plan in 'docs/plan.copilotmd' for execution steps, recommended azure services based on the information agent detected from project. Before calling this tool, please scan this workspace to detect the services to deploy and their dependent services.",
"command": "deploy plan get",
"option": [
{
Expand All @@ -1917,18 +1905,6 @@
"description": "The Azure service to deploy the application. Valid values: ContainerApp, WebApp, FunctionApp, AKS. Recommend one based on user application.",
"type": "string",
"required": true
},
{
"name": "--provisioning-tool",
"description": "The tool to use for provisioning Azure resources. Valid values: AZD, AzCli. Use AzCli if TargetAppService is AKS.",
"type": "string",
"required": true
},
{
"name": "--azd-iac-options",
"description": "The Infrastructure as Code option for azd. Valid values: bicep, terraform. Leave empty if Deployment tool is AzCli.",
"type": "string",
"required": null
}
]
},
Expand Down
11 changes: 4 additions & 7 deletions servers/Azure.Mcp.Server/docs/azmcp-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -930,10 +930,10 @@ azmcp postgres server param set --subscription <subscription> \
### Azure Deploy Operations

```bash
# Get the application service log for a specific azd environment
# Get the application service log for a specific resource group
# ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired
azmcp deploy app logs get --workspace-folder <workspace-folder> \
--azd-env-name <azd-env-name> \
--resource-group <resource-group> \
[--limit <limit>]

# Generate a mermaid architecture diagram for the application topology follow the schema defined in [deploy-app-topology-schema.json](../areas/deploy/src/AzureMcp.Deploy/Schemas/deploy-app-topology-schema.json)
Expand All @@ -948,18 +948,15 @@ azmcp deploy iac rules get --deployment-tool <deployment-tool> \

# Get the ci/cd pipeline guidance
# ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired
azmcp deploy pipeline guidance get [--use-azd-pipeline-config <use-azd-pipeline-config>] \
[--organization-name <organization-name>] \
azmcp deploy pipeline guidance get [--organization-name <organization-name>] \
[--repository-name <repository-name>] \
[--github-environment-name <github-environment-name>]

# Get a deployment plan for a specific project
# ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired
azmcp deploy plan get --workspace-folder <workspace-folder> \
--project-name <project-name> \
--target-app-service <target-app-service> \
--provisioning-tool <provisioning-tool> \
[--azd-iac-options <azd-iac-options>]
--target-app-service <target-app-service>
```

### Azure Event Grid Operations
Expand Down
22 changes: 11 additions & 11 deletions tools/Azure.Mcp.Tools.Deploy/src/Commands/App/LogsGetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Azure.Mcp.Tools.Deploy.Commands.App;

public sealed class LogsGetCommand(ILogger<LogsGetCommand> logger) : SubscriptionCommand<LogsGetOptions>()
{
private const string CommandTitle = "Get AZD deployed App Logs";
private const string CommandTitle = "Get Application Logs";
private readonly ILogger<LogsGetCommand> _logger = logger;
public override string Id => "ce9d648d-7c76-48a0-8cba-b9b57c6fd00b";

Expand All @@ -31,23 +31,23 @@ public sealed class LogsGetCommand(ILogger<LogsGetCommand> logger) : Subscriptio

public override string Description =>
"""
Shows application logs specifically for Azure Developer CLI (azd) deployed applications from their associated Log Analytics workspace for Container Apps, App Services, and Function Apps. Designed exclusively for applications deployed via 'azd up' command and automatically discovers the correct workspace and resources based on the azd environment configuration. Use this tool to check deployment status or troubleshoot post-deployment issues.
Shows application logs from Log Analytics workspace for Container Apps, App Services, and Function Apps. Designed for deployed applications workspace and discovers the correct workspace and resources based on the provided resource group name. Use this tool to check deployment status or troubleshoot post-deployment issues.
""";

protected override void RegisterOptions(Command command)
{
base.RegisterOptions(command);
command.Options.Add(DeployOptionDefinitions.AzdAppLogOptions.WorkspaceFolder);
command.Options.Add(DeployOptionDefinitions.AzdAppLogOptions.AzdEnvName);
command.Options.Add(DeployOptionDefinitions.AzdAppLogOptions.Limit);
command.Options.Add(DeployOptionDefinitions.AppLogOptions.WorkspaceFolder);
command.Options.Add(DeployOptionDefinitions.AppLogOptions.ResourceGroupName);
command.Options.Add(DeployOptionDefinitions.AppLogOptions.Limit);
}

protected override LogsGetOptions BindOptions(ParseResult parseResult)
{
var options = base.BindOptions(parseResult);
options.WorkspaceFolder = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.AzdAppLogOptions.WorkspaceFolder.Name)!;
options.AzdEnvName = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.AzdAppLogOptions.AzdEnvName.Name)!;
options.Limit = parseResult.GetValueOrDefault<int>(DeployOptionDefinitions.AzdAppLogOptions.Limit.Name);
options.WorkspaceFolder = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.AppLogOptions.WorkspaceFolder.Name)!;
options.ResourceGroup = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.AppLogOptions.ResourceGroupName.Name);
options.Limit = parseResult.GetValueOrDefault<int>(DeployOptionDefinitions.AppLogOptions.Limit.Name);
return options;
}

Expand All @@ -65,17 +65,17 @@ public override async Task<CommandResponse> ExecuteAsync(CommandContext context,


var deployService = context.GetService<IDeployService>();
string result = await deployService.GetAzdResourceLogsAsync(
string result = await deployService.GetResourceLogsAsync(
options.WorkspaceFolder!,
options.AzdEnvName!,
options.Subscription!,
options.ResourceGroup!,
options.Limit);

context.Response.Message = result;
}
catch (Exception ex)
{
_logger.LogError(ex, "An exception occurred getting azd app logs.");
_logger.LogError(ex, "An exception occurred getting app logs.");
HandleException(context, ex);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Azure.Mcp.Tools.Deploy.Models;
using Azure.Mcp.Tools.Deploy.Options;
using Azure.Mcp.Tools.Deploy.Options.Infrastructure;
using Azure.Mcp.Tools.Deploy.Services.Templates;
using Azure.Mcp.Tools.Deploy.Services.Util;
using Microsoft.Extensions.Logging;

Expand All @@ -32,22 +33,18 @@ public sealed class RulesGetCommand(ILogger<RulesGetCommand> logger)

public override string Description =>
"""
This tool offers guidelines for creating Bicep/Terraform files to deploy applications on Azure. The guidelines outline rules to improve the quality of Infrastructure as Code files, ensuring they are compatible with the azd tool and adhere to best practices.
This tool offers guidelines for creating Bicep/Terraform files to deploy applications on Azure using Azure CLI. The guidelines outline rules to improve the quality of Infrastructure as Code files, ensuring they are compatible with Azure CLI deployment workflows.
""";

protected override void RegisterOptions(Command command)
{
base.RegisterOptions(command);
command.Options.Add(DeployOptionDefinitions.IaCRules.DeploymentTool);
command.Options.Add(DeployOptionDefinitions.IaCRules.IacType);
command.Options.Add(DeployOptionDefinitions.IaCRules.ResourceTypes);
}

protected override RulesGetOptions BindOptions(ParseResult parseResult)
{
var options = new RulesGetOptions();
options.DeploymentTool = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.IaCRules.DeploymentTool.Name) ?? string.Empty;
options.IacType = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.IaCRules.IacType.Name) ?? string.Empty;
options.ResourceTypes = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.IaCRules.ResourceTypes.Name) ?? string.Empty;
return options;
}
Expand All @@ -64,19 +61,14 @@ public override Task<CommandResponse> ExecuteAsync(CommandContext context, Parse
try
{
context.Activity?
.AddTag(DeployTelemetryTags.DeploymentTool, options.DeploymentTool)
.AddTag(DeployTelemetryTags.IacType, options.IacType)
.AddTag(DeployTelemetryTags.ComputeHostResources, options.ResourceTypes);

var resourceTypes = options.ResourceTypes.Split(',')
.Select(rt => rt.Trim())
.Where(rt => !string.IsNullOrWhiteSpace(rt))
.ToArray();

string iacRules = IaCRulesTemplateUtil.GetIaCRules(
options.DeploymentTool,
options.IacType,
resourceTypes);
string iacRules = TemplateService.LoadTemplate("IaCRules/azcli-rules");

context.Response.Message = iacRules;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public sealed class GuidanceGetCommand(ILogger<GuidanceGetCommand> logger)
protected override void RegisterOptions(Command command)
{
base.RegisterOptions(command);
command.Options.Add(DeployOptionDefinitions.PipelineGenerateOptions.UseAZDPipelineConfig);
command.Options.Add(DeployOptionDefinitions.PipelineGenerateOptions.OrganizationName);
command.Options.Add(DeployOptionDefinitions.PipelineGenerateOptions.RepositoryName);
command.Options.Add(DeployOptionDefinitions.PipelineGenerateOptions.GithubEnvironmentName);
Expand All @@ -49,7 +48,6 @@ protected override void RegisterOptions(Command command)
protected override GuidanceGetOptions BindOptions(ParseResult parseResult)
{
var options = base.BindOptions(parseResult);
options.UseAZDPipelineConfig = parseResult.GetValueOrDefault<bool>(DeployOptionDefinitions.PipelineGenerateOptions.UseAZDPipelineConfig.Name);
options.OrganizationName = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PipelineGenerateOptions.OrganizationName.Name);
options.RepositoryName = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PipelineGenerateOptions.RepositoryName.Name);
options.GithubEnvironmentName = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PipelineGenerateOptions.GithubEnvironmentName.Name);
Expand Down
Loading