Share via

Azure AI Foundry agents intermittently failing with JSON parsing error (empty response, no schema changes)

Maximiliano Gutierrez 5 Reputation points
2026-02-26T13:01:19.7233333+00:00

We are experiencing intermittent but increasingly frequent failures when running agents on Azure AI Foundry. Agents that were working correctly in the same environment, with no code or schema changes, suddenly started failing with the following error:

The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.

Key points:

We are using structured output with a stable schema that has not changed.

The client, configuration, and environment are unchanged.

The error appears to be caused by the runtime receiving an empty or non-JSON response when a final JSON block is expected.

The issue occurs both via the Agent Framework / SDK (e.g. ChatAgentClient with RunAsync) and sometimes directly in the portal, suggesting it is not limited to client-side code.

Failures are intermittent (agents may work and then fail for extended periods), which points to possible service instability or regional issues rather than deterministic bugs.

Similar reports from other users indicate upstream empty responses, transient 5xx errors, or internal service regressions.

We are unable to find any corresponding incident or degradation reported on the Azure Status page or Foundry forums. Is this a known issue or ongoing incident with Azure AI Foundry (agents, model routing, or streaming/final block handling)? Are there recommended mitigations or regions/models to avoid while this is being investigated?

Azure AI Speech
Azure AI Speech

An Azure service that integrates speech processing into apps and services.

0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Maximiliano Gutierrez 5 Reputation points
    2026-02-26T13:05:23.6666667+00:00

    Additionally, the issue does not happen continuously but recurs several hours per week. On some nights the service becomes unavailable or agents stop responding, and then recovers later without any changes on our side.

    Yesterday was the most noticeable case so far, as the agents were failing for multiple consecutive hours, which caused a broader impact.

    Given the recurring nature of the problem, we are currently evaluating a fallback / plan B using Anthropic** (Claude)** to ensure minimum service continuity when Azure AI Foundry becomes unstable.

    0 comments No comments

  2. Q&A Assist
    2026-02-26T13:01:39.6333333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The provided context does not state that this specific intermittent JSON parsing issue with Azure AI Foundry agents is a known, active incident, nor does it list any model/region combinations to avoid. It also does not describe empty final blocks or structured-output regressions as a documented problem.

    However, the context does include general guidance for troubleshooting Azure AI Foundry agents and platform/runtime issues that can be applied to this situation:

    1. Differentiate 4xx vs 5xx / platform vs configuration issues
      • If agent deployments or invocations are returning 5xx status codes, the hosted agent guidance is to contact Microsoft support because these indicate service-side problems.
      • If 4xx errors are present, inspect the error classification and fix configuration issues such as invalid request fields (ValidationError), generic UserError, or model configuration problems.
    2. Check hosted agent runtime health and logs
      For agents that deploy but behave unexpectedly (for example, intermittent failures, timeouts, or malformed responses):
      • Confirm the agent status is Started and not still initializing.
      • Use the log stream API to inspect container logs in real time and see whether the model/tool call is returning an empty or malformed payload before structured-output parsing.
      • Use the Traces tab in the Foundry portal playground to inspect full request/response traces and verify that the model’s raw output is valid JSON and matches expectations.
      • Verify that all environment variables (for example, model deployment names) are correct and stable.
    3. Validate model configuration and deployment name
      The hosted agent troubleshooting guidance calls out model errors when the deployment name is invalid. For structured outputs, a misconfigured or intermittently unavailable model deployment can surface as unexpected runtime behavior. Verify that:
      • The MODEL_NAME or equivalent environment variable in the agent definition matches an existing, healthy model deployment.
      • There are no recent changes to the deployment (SKU, region, or routing) that could affect responses.
    4. Use standard runtime troubleshooting patterns for intermittent issues
      The general runtime troubleshooting steps for hosted agents apply to intermittent JSON/structured-output failures as well:
      • Check for slow response times or timeout errors that might cause truncated or empty responses; if needed, increase timeouts or break long operations into smaller steps.
      • Ensure replica scaling (min_replicas) is appropriate so that cold starts or scaling events are not causing intermittent failures.
      • Confirm that any tool calls used by the agent are configured correctly and that managed identities have the required access; failing tools can result in incomplete or empty final responses.
    5. When to escalate to Microsoft support
      The hosted agent documentation explicitly states that if the agent endpoint returns 5xx status codes, the next step is to contact Microsoft support. For intermittent empty responses or parsing failures that are not explained by configuration, logs, or traces, and especially when they reproduce in the portal:
      • Collect request IDs, timestamps, and regions from the Traces and logs.
      • Open a support case with these details so the service team can investigate potential regional or platform regressions.

    The context does not provide any explicit recommendation to avoid specific regions or models, nor does it document a known incident matching the described behavior. The supported mitigations are therefore to follow the hosted agent runtime troubleshooting steps, verify configuration and model deployment, and escalate to Microsoft support when 5xx or unexplained intermittent runtime failures occur.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.