Skip to content

Chapter 13 · Operate

Troubleshooting

When something breaks, the HTTP status code usually tells you which box in the architecture to look at. Start with the decision tree, then use the symptom-cause-fix table for specifics.

🎯 What you'll be able to do

  • Use status codes to localise a failure to one component
  • Diagnose the most common 401, 403, origin, and payload errors
  • Recognise the 'no tools listed' connector problem

Decision tree

Start at the top with the status code or symptom, then follow the branch to the likely cause and fix.

The fastest triage: let the status code point you at the right component.
Why status codes matter
A 401 means “who are you?” (authentication) — the token problem. A 403 means “I know who you are, but no” (authorization) — either the gateway didn't trust the call, or Jira denied the user. Telling them apart saves hours.

Symptom · cause · fix

SymptomLikely causeFix
/mcpMissing or malformed bearer tokenReauthenticate the connection; verify the Authorization header reaches APIM.
/mcp 403 gateway errorApp didn't receive correct X-Gateway-TokenCall through APIM; verify the Key Vault named value resolved; verify the app setting.
Origin blockedOrigin not in ALLOWED_ORIGINSAdd the correct Copilot Studio / Power Platform origin; never use wildcard in production.
Jira returns 403User lacks permission or wrong site selectedVerify Jira project permissions; pin JIRA_SITE_URL if needed.
No tools listed in Copilot StudioConnector imported as REST or MCP extension missingReimport mcp-connector.swagger.json and preserve x-ms-agentic-protocol.
Atlassian sign-in failsRedirect URI mismatchMatch the Atlassian callback URL to the Power Platform connector redirect URL.
Token refresh failsMissing offline_accessAdd the scope to the Atlassian app and the connector.
AsyncResponsePayloadTooLargeResponse budget too high or tool returns too muchLower MAX_RESPONSE_BYTES and MAX_RESULTS_CAP; trim fields more aggressively.
Local server starts but Jira calls failNo real Atlassian tokenUse a Copilot Studio connection or supply a valid short-lived token for tests.
APIM deploy succeeds but calls failPlaceholder IP filter still activeReplace or temporarily remove REPLACE_START_IP / REPLACE_END_IP.
Container does not startWrong image, port, or dependency issueCheck App Service / Container Apps logs; verify PORT and WEBSITES_PORT.

Concept check

Calls through APIM return 403 with a gateway message, but the app's own /healthz is fine and a direct call to the app host (bypassing APIM) actually works. What does this tell you?

📌 Chapter summary

  • 401 → token; 403 → gateway secret or Jira permission.
  • No tools → connector imported as REST (missing MCP extension).
  • Payload errors → lower MAX_RESPONSE_BYTES / MAX_RESULTS_CAP and trim harder.

✅ End-of-chapter review

0/4 done