Edit

Share via


Azure Deploy tools for the Azure MCP Server overview

Azure MCP Server simplifies Azure resource deployment by providing a unified experience for deploying applications and infrastructure. This article explains how to use Azure MCP Server to streamline your deployment process and improve efficiency.

App: Get logs

This tool fetches logs from the Log Analytics workspace for Container Apps, App Services, and Function Apps deployed by using Azure Developer CLI. Use it after a successful azd up to check app status or troubleshoot errors in deployed applications.

Example prompts include:

  • Fetch app logs: "Get logs for my app service in workspace folder '/home/user/myapp' with AZD environment 'production'."
  • View deployment logs: "Show me the latest deployment logs for my container app in workspace folder '/home/user/myapp' with AZD environment 'dev'."
  • Check function logs: "Retrieve logs for my function app in workspace folder '/home/user/myapp' with AZD environment 'staging'."
  • Troubleshoot app: "Show error logs for my web app deployed with azd in workspace folder '/home/user/myapp' and environment 'production'."
  • Get logs with limit: "Get the last 50 logs for my app service in workspace folder '/home/user/myapp' with AZD environment 'prod' and limit 50."
Parameter Required or optional Description
Workspace folder Required The full path of the workspace folder.
AZD environment Required The name of the environment created by AZD in the AZURE_ENV_NAME variable during azd init or azd up.
Limit Optional The maximum row number of logs to retrieve. Use this to get a specific number of logs or to avoid the retrieved logs from reaching token limit. Default is 200.

Tool annotation hints:

Destructive: ❌ | Idempotent: ✅ | Open World: ❌ | Read Only: ✅ | Secret: ❌ | Local Required: ❌

Architecture: Generate mermaid diagram

Generate a Mermaid architecture diagram for the application topology.

Example prompts include:

  • Generate architecture diagram: "Create a Mermaid diagram for my Azure application with input 'web app connected to SQL database'."
  • Show app topology: "Visualize the architecture of my deployed services with input 'container app, function app, and cosmos db'."
  • Diagram resources: "Generate a diagram for all resources with input 'app service, storage account, and key vault'."
  • App structure diagram: "Show the structure with input 'container app processing queue messages and function app handling events'."
  • Service relationship diagram: "Create a diagram with input 'web app connects to database and redis cache'."
Parameter Required or optional Description
Raw input Required The raw input to process.

Tool annotation hints:

Destructive: ❌ | Idempotent: ✅ | Open World: ❌ | Read Only: ✅ | Secret: ❌ | Local Required: ❌

Infrastructure as Code: Get guidance

This tool offers guidance for creating Bicep or 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.

Example prompts include:

  • IaC guidance for Bicep: "Give me best practices for Bicep files for my web app using deployment tool 'AZD' with IaC type 'bicep' and resource types 'appservice'."
  • Terraform rules: "What are the guidelines for writing Terraform for Azure Container Apps using deployment tool 'AZD' with IaC type 'terraform' and resource types 'containerapp'?"
  • Resource-specific rules: "Show me IaC rules for deploying appservice and aks using deployment tool 'AzCli'."
  • AZD compatibility: "How do I make my Bicep files compatible with deployment tool 'AZD' for IaC type 'bicep'?"
  • IaC for multiple resources: "Provide guidance using deployment tool 'AZD' with IaC type 'bicep' for resource types 'appservice,containerapp,function'."
Parameter Required or optional Description
Deployment tool Required The deployment tool to use. Valid values: AZD, AzCli.
Infrastructure as code file type Optional The Infrastructure as Code type. Valid values: bicep, terraform. Leave empty if deployment tool is the Azure CLI.
Resource types Optional Specifies the Azure resource types to retrieve IaC rules for. Use a comma-separated list. Supported values are: appservice, containerapp, function, aks. Leave empty if you don't use these services.

Tool annotation hints:

Destructive: ❌ | Idempotent: ✅ | Open World: ❌ | Read Only: ✅ | Secret: ❌ | Local Required: ❌

Pipeline: Get guidance

Get guidance to create a CI/CD pipeline that provisions Azure resources and builds and deploys applications to Azure. Use this tool before creating a GitHub Actions workflow file for deployment on Azure. Ensure infrastructure files are ready and the application is ready to be containerized.

Example prompts include:

  • CI/CD pipeline setup: "How do I set up a CI/CD pipeline for my Azure app?"
  • GitHub Actions guidance: "Give me guidance for creating a GitHub Actions workflow for deployment."
  • Pipeline for containerized app: "What are the steps to build and deploy a container app using AZD?"
  • Environment-specific pipeline: "Set up a pipeline for deploying to the 'staging' environment."
  • Pipeline configuration: "Show me how to use azure.yaml for pipeline setup."
Parameter Required or optional Description
Use AZD pipeline configuration Optional Whether to use the AZD tool to set up the deployment pipeline. Set to true only if you provide azure.yaml or the context suggests AZD tools.
Organization Optional The name of the organization or the user account name of the current GitHub repository.
Repository Optional The name of the current GitHub repository.
GitHub environment Optional The name of the environment to which the deployment pipeline will be deployed.

Tool annotation hints:

Destructive: ❌ | Idempotent: ✅ | Open World: ❌ | Read Only: ✅ | Secret: ❌ | Local Required: ❌

Plan: Create deployment plan

Generates a deployment plan to build the infrastructure and deploy the application on Azure. The agent reads the output and creates a deployment plan in .azure/plan.copilotmd for execution steps, with recommended Azure services based on the information detected from the project.

Example prompts include:

  • Generate deployment plan: "Create a deployment plan for my Azure web app in workspace folder '/home/user/myapp' with project 'mywebapp' using target app service 'WebApp' and provisioning tool 'AZD' with IaC option 'bicep'."
  • Plan for multiple services: "Generate a plan to deploy container app in workspace folder '/home/user/myapp' with project 'mycontainerapp' using target app service 'ContainerApp' and provisioning tool 'AZD' with IaC option 'bicep'."
  • Deployment steps: "Show me the steps to deploy my project 'myproject' in workspace folder '/home/user/myapp' using target app service 'WebApp' and provisioning tool 'AZD' with IaC option 'bicep'."
  • Service recommendation: "Recommend Azure services and generate a plan for project 'myapp' in workspace folder '/home/user/myapp' using target app service 'ContainerApp' and provisioning tool 'AZD'."
  • Provisioning plan: "Create a plan for project 'myproject' in workspace folder '/home/user/myapp' using target app service 'AKS' and provisioning tool 'AzCli'."
Parameter Required or optional Description
Workspace folder Required The full path of the workspace folder.
Project Required The name of the project to generate the deployment plan for. If not provided, the name is inferred from the workspace.
Target app service Required The Azure service to deploy the application. Valid values: ContainerApp, WebApp, FunctionApp, AKS. Recommend one based on user application.
Provisioning tool Required The tool to use for provisioning Azure resources. Valid values: AZD, AzCli. Use AzCli if TargetAppService is AKS.
Azd IaC options Optional The Infrastructure as Code option for AZD. Valid values: bicep, terraform. Leave empty if Deployment tool is AzCli.

Tool annotation hints:

Destructive: ❌ | Idempotent: ✅ | Open World: ❌ | Read Only: ✅ | Secret: ❌ | Local Required: ❌