[!WARNING] EXPERIMENTAL ONLY: This setup is for development and sandbox testing. Do not use this repository or its generated workflows for production Azure operations. Review permissions and commands carefully before running them.
This document explains how to configure the Azure MCP server to enable Azure deployment capabilities for the Git-Ape agent system.
The Azure MCP server is provided by the ms-azuretools.vscode-azure-mcp-server extension. It should be automatically available if you have Azure Tools for VS Code installed.
Verify installation:
code --list-extensions | grep azure-mcp
You should see: ms-azuretools.vscode-azure-mcp-server
Add the following to your VS Code settings (.vscode/settings.json or User Settings):
{
"azureMcp.serverMode": "namespace",
"azureMcp.enabledServices": [
"deploy",
"bestpractices",
"group",
"subscription",
"resourcehealth",
"monitor",
"functionapp",
"storage",
"sql",
"cosmos",
"bicepschema",
"cloudarchitect"
],
"azureMcp.readOnly": false
}
Configuration Options:
serverMode: Controls how MCP tools are exposed
"single": One tool that routes to 100+ internal commands"namespace": ~30 logical groups by service (recommended)"all": Every MCP tool exposed directly (100+ tools)enabledServices: Array of service namespaces to expose
readOnly: When true, prevents destructive operations
false to allow deploymentstrue for testing/validation onlyAuthenticate with Azure CLI:
# Login to Azure
az login
# Set default subscription (optional but recommended)
az account set --subscription "Your Subscription Name or ID"
# Verify authentication
az account show
The Azure MCP server uses your Azure CLI credentials automatically.
Create a .env file in your workspace root for default values:
# Azure Subscription
AZURE_SUBSCRIPTION_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
# Default Region
AZURE_DEFAULT_REGION=eastus
# Default Resource Group (optional)
AZURE_DEFAULT_RESOURCE_GROUP=rg-git-ape-dev-eastus
The following services are used by the Git-Ape agents:
deploy - ARM template deployment, what-if analysis, validationbestpractices - Security and configuration recommendationscloudarchitect - Architecture diagram generationgroup - Resource group operationssubscription - Subscription queries and managementresourcehealth - Resource status and health monitoringmonitor - Logging, metrics, and monitoringfunctionapp - Azure Functions managementaks - Azure Kubernetes Service (optional)acr - Azure Container Registry (optional)storage - Blob, Table, Queue, File storagesql - Azure SQL Databasecosmos - Cosmos DBmysql, postgres - Database services (optional)bicepschema - Bicep/ARM template schemaskeyvault - Secrets, keys, certificatesAfter configuration, verify the MCP server is working:
@git-apeTo test Azure MCP tools are accessible:
In Copilot Chat:
"List available Azure subscriptions"
Expected: The agent should use Azure MCP tools to query subscriptions
Cause: Azure MCP server not loaded or not configured
Solution:
code --list-extensions | grep azure-mcpCmd/Ctrl + Shift + P → “Reload Window”azureMcp.serverMode configuredCause: Azure CLI not authenticated or token expired
Solution:
# Re-authenticate
az login
# Verify
az account show
# If multiple subscriptions, set default
az account set --subscription "Your Subscription"
Cause: Azure account lacks Contributor role on subscription/resource group
Solution:
az role assignment list --assignee $(az account show --query user.name -o tsv)Cause: Too many services enabled or network latency
Solution:
enabledServices to only what you need"namespace" mode instead of "all"Cause: Services not in enabledServices list
Solution:
Add required services to azureMcp.enabledServices array in settings.json
.env for local development (add to .gitignore)The agents require these minimum Azure permissions:
Reader roleReader roleContributor role on target resource groupsConsider creating a custom role:
{
"Name": "Git-Ape Deployer",
"Description": "Deploy Azure resources via Git-Ape agent",
"Actions": [
"Microsoft.Resources/deployments/*",
"Microsoft.Resources/subscriptions/resourceGroups/*",
"Microsoft.Web/sites/*",
"Microsoft.Storage/storageAccounts/*",
"Microsoft.Insights/components/*"
],
"AssignableScopes": [
"/subscriptions/{subscription-id}"
]
}
For production deployments:
azureMcp.readOnly: false only when deployingIf you want more control over which specific tools are available:
{
"azureMcp.serverMode": "all",
"azureMcp.toolFilter": [
"deploy_group_create",
"deploy_group_what_if",
"storage_account_create",
"functionapp_create"
]
}
This exposes only specific tool commands instead of entire service namespaces.
If you work with multiple Azure tenants/subscriptions:
# Login to different tenant
az login --tenant "tenant-id"
# Switch between subscriptions
az account set --subscription "subscription-1"
# Deploy resources...
az account set --subscription "subscription-2"
# Deploy to different subscription...
The agent will use whichever subscription is currently active in Azure CLI.
After configuration:
@git-ape deploy a resource group