An Azure service that provides a general-purpose, serverless container platform.
The logs indicate that the container itself is failing its startup probe (connection refused), and the exec WebSocket error is a consequence of the app not being healthy rather than the root cause. Focus on getting the MCP server inside the container to start and listen correctly before using the “Connect”/exec feature.
Use the following checks and steps:
- Verify the container is reachable on the configured port
- The environment variable
PORTis set to8080. Confirm that the MCP server process inside the image is actually listening on port8080. - In the Container Apps definition, ensure:
- The container’s
targetPortis8080. - Any startup probe / liveness / readiness probes are configured to hit the correct port and path (for MCP over HTTP this is typically
/mcpor whatever the server exposes).
- The container’s
- If the probe is configured on a different port or path, it will fail with
connection refusedand keep the replica inReplicaUnhealthystate.
- The environment variable
- Confirm MCP endpoint path and transport
- With
MCP_TRANSPORT=http, the server is expected to expose an HTTP JSON-RPC endpoint. - For most MCP server frameworks on Container Apps, the common path is
/mcp:- For .NET
MapMcp→/mcp - For Python FastMCP →
/mcp - For Node.js Express →
/mcp
- For .NET
- Ensure the startup/readiness probe and any external tests use the correct path. A wrong path can result in 404s or connection issues.
- With
- Test the MCP server directly with curl
- Before using the Container Apps exec console, validate that the app responds:
curl -X POST "https://<APP_NAME>.azurecontainerapps.io/mcp" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":"1","method":"initialize"}' - Replace
<APP_NAME>with the container app name and adjust the path if the server uses a different route. - If this call fails or times out, the issue is with the app startup or ingress configuration, not with MCP monitoring.
- Before using the Container Apps exec console, validate that the app responds:
- Check container logs for application errors
- Use Container Apps log streaming to see why the MCP server process is exiting or not binding to the port:
az containerapp logs show \ --name azure-monitor-mcp \ --resource-group <RESOURCE_GROUP> \ --follow - Look for stack traces, binding errors (e.g., wrong port), or configuration errors related to
MCP_TRANSPORT,MCP_MODE, or workspace settings.
- Use Container Apps log streaming to see why the MCP server process is exiting or not binding to the port:
- Validate ingress and environment
- Ensure ingress is configured correctly (for example, external ingress if the MCP server must be reachable from outside) and that the FQDN is correct.
- If using browser-based MCP clients, also ensure CORS is configured, but this is secondary to fixing the startup probe failure.
Once the container starts successfully (startup probe passes and the replica is healthy), the exec WebSocket connection from the Container Apps “Connect” experience should stop returning HTTP 500 and the MCP monitoring scenario can proceed.
References: