Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2,403 changes: 2,403 additions & 0 deletions AzureMcp.sln

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions servers/Azure.Mcp.Server/docs/azmcp-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -1059,18 +1059,17 @@ 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>] \
[--repository-name <repository-name>] \
[--github-environment-name <github-environment-name>]
azmcp deploy pipeline guidance get [--is-azd-project <is-azd-project>] \
[--pipeline-platform <pipeline-platform>] \
[--deploy-option <deploy-option>]

# 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> \
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The azmcp deploy plan get docs were only updated to rename --azd-iac-options to --iac-options, but the tool now also supports/accepts --source-type, --deploy-option, and --resource-group-name (and subscription via SubscriptionOptions). Update this command snippet to include the new flags (and indicate which are required vs optional) so the docs match the actual CLI surface.

Suggested change
--provisioning-tool <provisioning-tool> \
--provisioning-tool <provisioning-tool> \
--source-type <source-type> \
[--deploy-option <deploy-option>] \
[--resource-group-name <resource-group-name>] \
[--subscription <subscription>] \

Copilot uses AI. Check for mistakes.
[--azd-iac-options <azd-iac-options>]
[--iac-options <iac-options>]
```

### Azure Event Grid Operations
Expand Down
6 changes: 3 additions & 3 deletions servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ This file contains prompts used for end-to-end testing to ensure each tool is in
|:----------|:----------|
| deploy_app_logs_get | Show me the log of the application deployed by azd |
| deploy_architecture_diagram_generate | Generate the azure architecture diagram for this application |
| deploy_iac_rules_get | Show me the rules to generate bicep scripts |
| deploy_pipeline_guidance_get | How can I create a CI/CD pipeline to deploy this app to Azure? |
| deploy_plan_get | Create a plan to deploy this application to azure |
| deploy_iac_rules_get | Show me the rules to generate bicep scripts for \<resource-type> |
| deploy_pipeline_guidance_get | Help me set up a CI/CD pipeline to deploy to Azure. |
| deploy_plan_get | Scan my project carefully to identify all Azure-relevant resources, programming languages, frameworks, dependencies, and configuration files needed for deployment. Develop a provision-and-deploy plan and follow it to deploy my application to Azure. deployTool: azcli, IacType: Terraform, hosting service: Container Apps.|

## Azure Event Grid

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<ItemGroup>
<ProjectReference Include="..\..\..\core\Azure.Mcp.Core\src\Azure.Mcp.Core.csproj" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<PackageReference Include="Azure.Core" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
Expand All @@ -20,7 +19,7 @@
<PackageReference Include="Azure.ResourceManager.AppService" />
<PackageReference Include="Azure.ResourceManager.AppContainers" />
<PackageReference Include="Azure.ResourceManager.Resources" />
<PackageReference Include="Azure.ResourceManager.Compute"/>
<PackageReference Include="Azure.ResourceManager.Compute" />
<PackageReference Include="Azure.ResourceManager.MachineLearning" />
<PackageReference Include="Azure.ResourceManager.Network" />
<PackageReference Include="Azure.ResourceManager.ContainerInstance" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ 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 as well as general Azure Resource Rules. The guidelines outline rules to improve the quality of Infrastructure as Code files and resource configurations, ensuring they are compatible with the azd tool or az cli and adhere to best practices.
""";

protected override void RegisterOptions(Command command)
Expand Down Expand Up @@ -70,7 +70,7 @@ public override Task<CommandResponse> ExecuteAsync(CommandContext context, Parse
.AddTag(DeployTelemetryTags.ComputeHostResources, options.ResourceTypes);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed class GuidanceGetCommand(ILogger<GuidanceGetCommand> logger)

public override string Description =>
"""
Guidance to create a CI/CD pipeline which provision Azure resources and build and deploy applications to Azure. Use this tool BEFORE generating/creating a Github actions workflow file for DEPLOYMENT on Azure. Infrastructure files should be ready and the application should be ready to be containerized.
This tool helps create a CI/CD pipeline to deploy a project to Azure. BEFORE calling this tool, you MUST confirm with user 1. if they want to use Github Actions or ADO pipeline 2. if they have existing Azure resources to deploy for different environments. If user has existing Azure resources, *ASK* for subscription ID, resource groups, environments, Azure hosting service TYPEs. If user does not have existing resources, *ASK* whether to include provision in the pipeline. *DO NOT call this tool UNTIL you made these confirmations with user*.
""";

public override string Title => CommandTitle;
Expand All @@ -41,19 +41,17 @@ 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);
command.Options.Add(DeployOptionDefinitions.PipelineGenerateOptions.isAZDProject);
command.Options.Add(DeployOptionDefinitions.PipelineGenerateOptions.pipelinePlatform);
command.Options.Add(DeployOptionDefinitions.PipelineGenerateOptions.deployOption);
}

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);
options.IsAZDProject = parseResult.GetValueOrDefault<bool>(DeployOptionDefinitions.PipelineGenerateOptions.isAZDProject.Name);
options.PipelinePlatform = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PipelineGenerateOptions.pipelinePlatform.Name);
options.DeployOption = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PipelineGenerateOptions.deployOption.Name);
return options;
}

Expand Down
18 changes: 13 additions & 5 deletions tools/Azure.Mcp.Tools.Deploy/src/Commands/Plan/GetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public sealed class GetCommand(ILogger<GetCommand> logger)

public override string 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.
Entry point to help the agent deploy a service to the cloud. Agent should read its output and generate a deploy plan in '.azure/plan.${COPILOT_MD_EXTENSION}' for execution steps, recommended Azure services based on the information agent detected from project. Before calling this tool, scan this workspace to detect the services to deploy and their dependent services. If user has existing resources and only wants to deploy to existing resources, agent MUST first help user to pick existing Azure resources's ARM ID with Az CLI command or prompt user to provide!
""";

public override string Title => CommandTitle;
Expand All @@ -47,7 +47,10 @@ protected override void RegisterOptions(Command command)
command.Options.Add(DeployOptionDefinitions.PlanGet.ProjectName);
command.Options.Add(DeployOptionDefinitions.PlanGet.TargetAppService);
command.Options.Add(DeployOptionDefinitions.PlanGet.ProvisioningTool);
command.Options.Add(DeployOptionDefinitions.PlanGet.AzdIacOptions);
command.Options.Add(DeployOptionDefinitions.PlanGet.IacOptions);
command.Options.Add(DeployOptionDefinitions.PlanGet.SourceType);
command.Options.Add(DeployOptionDefinitions.PlanGet.DeployOption);
command.Options.Add(DeployOptionDefinitions.PlanGet.ResourceGroupName);
}

protected override GetOptions BindOptions(ParseResult parseResult)
Expand All @@ -58,7 +61,10 @@ protected override GetOptions BindOptions(ParseResult parseResult)
ProjectName = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PlanGet.ProjectName.Name) ?? string.Empty,
TargetAppService = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PlanGet.TargetAppService.Name) ?? string.Empty,
ProvisioningTool = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PlanGet.ProvisioningTool.Name) ?? string.Empty,
AzdIacOptions = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PlanGet.AzdIacOptions.Name) ?? string.Empty
IacOptions = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PlanGet.IacOptions.Name) ?? string.Empty,
SourceType = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PlanGet.SourceType.Name) ?? string.Empty,
DeployOption = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PlanGet.DeployOption.Name) ?? string.Empty,
ResourceGroupName = parseResult.GetValueOrDefault<string>(DeployOptionDefinitions.PlanGet.ResourceGroupName.Name) ?? string.Empty
};
}

Expand All @@ -81,9 +87,11 @@ public override Task<CommandResponse> ExecuteAsync(CommandContext context, Parse
context.Activity?
.AddTag(DeployTelemetryTags.ComputeHostResources, options.TargetAppService)
.AddTag(DeployTelemetryTags.DeploymentTool, options.ProvisioningTool)
.AddTag(DeployTelemetryTags.IacType, options.AzdIacOptions ?? string.Empty);
.AddTag(DeployTelemetryTags.IacType, options.IacOptions ?? string.Empty)
.AddTag(DeployTelemetryTags.DeployOption, options.DeployOption ?? string.Empty)
.AddTag(DeployTelemetryTags.SourceType, options.SourceType ?? string.Empty);

var planTemplate = DeploymentPlanTemplateUtil.GetPlanTemplate(options.ProjectName, options.TargetAppService, options.ProvisioningTool, options.AzdIacOptions);
var planTemplate = DeploymentPlanTemplateUtil.GetPlanTemplate(options.ProjectName, options.TargetAppService, options.ProvisioningTool, options.SourceType ?? string.Empty, options.DeployOption ?? string.Empty, options.IacOptions, options.Subscription, options.ResourceGroupName);

context.Response.Message = planTemplate;
context.Response.Status = HttpStatusCode.OK;
Expand Down
2 changes: 2 additions & 0 deletions tools/Azure.Mcp.Tools.Deploy/src/Models/Consts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public static class DeployTelemetryTags
public static readonly string ComputeHostResources = AddPrefix("ComputeHostResources");
public static readonly string DeploymentTool = AddPrefix("DeploymentTool");
public static readonly string IacType = AddPrefix("IacType");
public static readonly string DeployOption = AddPrefix("DeployOption");
public static readonly string SourceType = AddPrefix("SourceType");
public static readonly string ProjectName = AddPrefix("ProjectName");
public static readonly string ServiceCount = AddPrefix("ServiceCount");
public static readonly string BackingServiceResources = AddPrefix("BackingServiceResources");
Expand Down
15 changes: 14 additions & 1 deletion tools/Azure.Mcp.Tools.Deploy/src/Models/IaCRulesParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ public static class DeploymentTool
public const string AzCli = "AzCli";
}

public static class SourceType
{
public const string FromAzure = "from-azure";
public const string FromProject = "from-project";
public const string FromContext = "from-context";
}

public static class IacType
{
public const string Bicep = "bicep";
Expand All @@ -18,5 +25,11 @@ public static class AzureServiceNames
public const string AzureContainerApp = "containerapp";
public const string AzureAppService = "appservice";
public const string AzureFunctionApp = "function";
public const string AzureStorage = "storage";
public const string AzureKubernetesService = "aks";
public const string AzureDatabaseForPostgreSql = "azuredatabaseforpostgresql";
public const string AzureDatabaseForMySql = "azuredatabaseformysql";
public const string AzureSqlDatabase = "azuresqldatabase";
public const string AzureCosmosDb = "azurecosmosdb";
public const string AzureStorageAccount = "azurestorageaccount";
public const string AzureKeyVault = "azurekeyvault";
}
14 changes: 14 additions & 0 deletions tools/Azure.Mcp.Tools.Deploy/src/Models/PipelineParameters.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Azure.Mcp.Tools.Deploy.Models;

public static class DeployOption
{
public const string ProvisionAndDeploy = "provision-and-deploy";
public const string DeployOnly = "deploy-only";
public const string ProvisionOnly = "provision-only";
}

public static class PipelinePlatform
{
public const string GitHubActions = "github-actions";
public const string AzureDevOps = "azure-devops";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

namespace Azure.Mcp.Tools.Deploy.Models.Templates;

/// <summary>
/// Parameters for generating deployment plan templates.
/// </summary>
public sealed class CLIExecutionStepsTemplateParameters
{
/// <summary>
/// The azure compute host display name.
/// </summary>
public string AzureComputeHost { get; set; } = string.Empty;

/// <summary>
/// The azure cli command group title
/// </summary>
public string TargetAppCommandTitle { get; set; } = string.Empty;

/// <summary>
/// The deployment steps
/// </summary>
public string DeploymentSteps { get; set; } = string.Empty;

/// <summary>
/// The IaC type
/// </summary>
public string IaCType { get; set; } = string.Empty;

/// <summary>
/// The step to check ACR dependencies
/// </summary>
public string ACRDependencyCheck { get; set; } = string.Empty;


/// <summary>
/// Converts the parameters to a dictionary for template processing.
/// </summary>
/// <returns>A dictionary with parameter names as keys and their values.</returns>
public Dictionary<string, string> ToDictionary()
{
return new Dictionary<string, string>
{
{ nameof(IaCType), IaCType },
{ nameof(AzureComputeHost), AzureComputeHost },
{ nameof(TargetAppCommandTitle), TargetAppCommandTitle },
{ nameof(DeploymentSteps), DeploymentSteps },
{ nameof(ACRDependencyCheck), ACRDependencyCheck }
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,32 @@ public sealed class DeploymentPlanTemplateParameters
/// </summary>
public string ExecutionSteps { get; set; } = string.Empty;


/// <summary>
/// The source of the plan to generate from.
/// </summary>
public string SourceType { get; set; } = string.Empty;

/// <summary>
/// The deploy option selected.
/// </summary>
public string DeployOption { get; set; } = string.Empty;

/// <summary>
/// The deployment goal of the plan
/// </summary>
public string Goal { get; set; } = string.Empty;

/// <summary>
/// The recommended resources or the existing(missing) resources
/// </summary>
public string ResourceInfo { get; set; } = string.Empty;

/// <summary>
/// The sample mermaid diagram for the deployment plan.
/// </summary>
public string SampleMermaid { get; set; } = string.Empty;

/// <summary>
/// Converts the parameters to a dictionary for template processing.
/// </summary>
Expand All @@ -58,6 +84,11 @@ public Dictionary<string, string> ToDictionary()
{ nameof(IacType), IacType },
{ nameof(AzureComputeHost), AzureComputeHost },
{ nameof(ExecutionSteps), ExecutionSteps },
{ nameof(SourceType), SourceType },
{ nameof(DeployOption), DeployOption },
{ nameof(Goal), Goal },
{ nameof(ResourceInfo), ResourceInfo },
{ nameof(SampleMermaid), SampleMermaid }
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ public sealed class IaCRulesTemplateParameters
public string FinalInstructions { get; set; } = string.Empty;
public string RequiredTools { get; set; } = string.Empty;
public string AdditionalNotes { get; set; } = string.Empty;
public string OutputFileName { get; set; } = string.Empty;
public string ContainerRegistryOutput { get; set; } = string.Empty;
public string RoleAssignmentResource { get; set; } = string.Empty;
public string ImageProperty { get; set; } = string.Empty;
public string CorsConfiguration { get; set; } = string.Empty;
public string LogAnalyticsConfiguration { get; set; } = string.Empty;
public string DiagnosticSettingsResource { get; set; } = string.Empty;

/// <summary>
/// Converts the parameters to a dictionary for template processing.
Expand All @@ -42,14 +35,7 @@ public Dictionary<string, string> ToDictionary()
{ nameof(ResourceSpecificRules), ResourceSpecificRules },
{ nameof(FinalInstructions), FinalInstructions },
{ nameof(RequiredTools), RequiredTools },
{ nameof(AdditionalNotes), AdditionalNotes },
{ nameof(OutputFileName), OutputFileName },
{ nameof(ContainerRegistryOutput), ContainerRegistryOutput },
{ nameof(RoleAssignmentResource), RoleAssignmentResource },
{ nameof(ImageProperty), ImageProperty },
{ nameof(CorsConfiguration), CorsConfiguration },
{ nameof(LogAnalyticsConfiguration), LogAnalyticsConfiguration },
{ nameof(DiagnosticSettingsResource), DiagnosticSettingsResource },
{ nameof(AdditionalNotes), AdditionalNotes }
};
}
}
Loading