Azure MCP Server Configuration
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.
Prerequisites​
- VS Code Insiders (or VS Code with GitHub Copilot extension)
- GitHub Copilot subscription (with access to Copilot Chat)
- Azure CLI installed and configured
- Azure MCP Server extension (should be installed automatically with Azure extensions)
Extension Installation​
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
Configuration​
1. VS Code Settings​
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- Only specified services will be available to agents
- Reduces tool clutter and improves agent focus
-
readOnly: Whentrue, prevents destructive operations- Set to
falseto allow deployments - Set to
truefor testing/validation only
- Set to
2. Azure Authentication​
Authenticate 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.
3. Environment Variables (Optional)​
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
Available Azure MCP Services​
The following services are used by the Git-Ape agents:
Core Deployment Services​
deploy- ARM template deployment, what-if analysis, validationbestpractices- Security and configuration recommendationscloudarchitect- Architecture diagram generation
Resource Management​
group- Resource group operationssubscription- Subscription queries and managementresourcehealth- Resource status and health monitoringmonitor- Logging, metrics, and monitoring
Compute Services​
functionapp- Azure Functions managementaks- Azure Kubernetes Service (optional)acr- Azure Container Registry (optional)
Data Services​
storage- Blob, Table, Queue, File storagesql- Azure SQL Databasecosmos- Cosmos DBmysql,postgres- Database services (optional)
Infrastructure​
bicepschema- Bicep/ARM template schemaskeyvault- Secrets, keys, certificates
Verification​
After configuration, verify the MCP server is working:
- Open VS Code
- Open GitHub Copilot Chat
- Type:
@git-ape - You should see "Git-Ape" in the agent picker
To test Azure MCP tools are accessible:
In Copilot Chat:
"List available Azure subscriptions"
Expected: The agent should use Azure MCP tools to query subscriptions
Troubleshooting​
Issue: "Unknown tool 'mcp_azure_mcp/*'"​
Cause: Azure MCP server not loaded or not configured
Solution:
- Verify extension is installed:
code --list-extensions | grep azure-mcp - Reload VS Code window:
Cmd/Ctrl + Shift + P→ "Reload Window" - Check settings have
azureMcp.serverModeconfigured
Issue: Azure authentication fails​
Cause: 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"
Issue: "Permission denied" on deployments​
Cause: Azure account lacks Contributor role on subscription/resource group
Solution:
- Verify your role:
az role assignment list --assignee $(az account show --query user.name -o tsv) - You need at least "Contributor" role for deployments
- Contact your Azure administrator to grant appropriate permissions
Issue: MCP tools are slow or unresponsive​
Cause: Too many services enabled or network latency
Solution:
- Reduce
enabledServicesto only what you need - Use
"namespace"mode instead of"all" - Check Azure service health: https://status.azure.com
Issue: Agent doesn't see Azure services​
Cause: Services not in enabledServices list
Solution:
Add required services to azureMcp.enabledServices array in settings.json
Security Considerations​
Credential Storage​
- Never commit Azure credentials to version control
- Use
.envfor local development (add to.gitignore) - In production/CI, use managed identities or Azure DevOps service connections
Least Privilege​
The agents require these minimum Azure permissions:
- Requirements Gatherer:
Readerrole - Template Generator:
Readerrole - Resource Deployer:
Contributorrole on target resource groups
Consider 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}"
]
}
Production Deployments​
For production deployments:
- Set
azureMcp.readOnly: falseonly when deploying - Use approval gates (the agent requires user confirmation)
- Enable Azure Policy to restrict resource types/regions
- Use separate subscriptions for dev/staging/prod
- Review ARM templates before confirming deployment
Advanced Configuration​
Custom MCP Server Mode​
If 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.
Multiple Azure Accounts​
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.
Next Steps​
After configuration:
- Test the agent with a simple deployment:
@git-ape deploy a resource group - Review the README.md for example workflows
- Customize workspace instructions in copilot-instructions.md
- Add your organization's naming conventions and policies