Microsoft 365: Publishing Autopilot Agent Fails with 502 Upstream Dependency Error

Panu Hällfors 0 Reputation points
2026-10-18T16:23:09.04+00:00

Problem description

*Note: I've posted the same question also earlier, but Microsoft support demands that I post it from the ticket again to proceed. The previous post, which did not yield a solution: https://learn.microsoft.com/en-us/answers/questions/6033359/microsoft-foundry-hello-world-autopilot-microsoft3 *

I am trying to deploy a Microsoft Foundry autopilot agent based on the official hello-world sample to Microsoft 365. While the deployment from azd deploy succeeds, attempting to publish the agent to Microsoft 365 results in a repeated HTTP 502 error with the message 'upstream_dependency_failed'. This failure occurs both through the Foundry UI and via direct API calls, and has been consistent over several days, and it also happens with another autopilot agent sample, and over several regions. I am seeking help to identify the specific upstream dependency causing this failure and how to resolve it.

Environment

Azure AI Foundry project in East US; agent based on samples/python/autopilot-agents/hello-world; publish target: Microsoft 365; deployment method: Azure Developer CLI (azd)

The same problem appears with a Swedish region as well.

What I've already tried

I deployed the sample successfully with azd deploy. Publishing the agent via the API and through the Foundry UI both failed with 502 upstream_dependency_failed. Repeated attempts over several days yielded the same result. I also tried deploying my own autopilot POC project, which also failed with the same error.

Current status

I am looking for assistance to determine the specific upstream dependency causing the failure, and guidance on how to resolve this issue to successfully publish the autopilot agent to Microsoft 365.

Foundry Agent Service
Foundry Agent Service

A fully managed platform in Microsoft Foundry for hosting, scaling, and securing AI agents built with any supported framework or model


2 answers

Sort by: Most helpful
  1. Ganesh Gurram 7,655 Reputation points Microsoft External Staff Moderator
    2026-10-23T17:49:35.3966667+00:00

    Hello - @Panu Hällfors

    Thanks for the question and using MS Q&A forum.

    Issue:

    Publishing a Microsoft Foundry agent to Microsoft 365 failed with HTTP 502 upstream_dependency_failed. The issue occurred through both the Foundry UI and API and was reproducible across multiple days.

    Resolution:

    The backend team confirmed that the issue has been fixed. A retry was requested to verify that publishing the agent to Microsoft 365 is now working as expected.

    Hope this helps. Do let me know if you have any further queries. 

    If this answers your query, please do click Accept Answer and Yes for was this answer helpful.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Alex Burlachenko 26,700 Reputation points MVP Volunteer Moderator
    2026-10-26T08:06:17.94+00:00

    Hi Panu Hällfors & thx for join me at Q&A platform,

    I went through your previous thread as well, and I think you've already done enough troubleshooting to establish that this isn't simply an azd deployment problem.

    The important distinction is that your hosted agent deploys successfully, but the Microsoft 365 autopilot blueprint publishing operation fails. You've reproduced the same 502 upstream_dependency_failed through both the Foundry UI and the direct REST API, across different samples and regions.

    That makes a local CLI issue or a problem specific to your agent code pretty unlikely.

    I also noticed from your earlier investigation that the agent appears in the Microsoft 365 admin center Registry, but the expected autopilot publishing and approval workflow doesn't complete. Registry synchronization and successful blueprint publishing are separate operations, so the Registry entry alone doesn't confirm that everything is provisioned correctly.

    The unresolved Frontier enrollment and terms acceptance status is still worth checking. However, I wouldn't conclude that licensing is causing the 502. Your existing Copilot Business and Agent 365 licenses shouldn't be dismissed simply because you don't have E7, and the response doesn't identify a specific eligibility failure.

    At this point, the most useful next step is a backend trace of the Microsoft 365 publishing request, not another redeployment. Ur earlier REST request returned upstream_dependency_failed with request ID 7f715b8302179e291627d107f7f90e3d, using API version 2025-11-15-preview.

    I'd ask the support engineer to correlate that request with the Foundry publishing service and its Microsoft 365 / Agent 365 dependencies, identify the exact operation that failed, and verify whether the tenant's autopilot enrollment and blueprint provisioning are complete. It's important to determine whether the 502 is masking an underlying tenant provisioning or authorization error, or whether an actual upstream service operation is failing. We can't reliably distinguish those possibilities from the public API response alone. Given that Microsoft Support specifically requested this new Q&A thread, I'd ask them to link it to your existing ticket and route the investigation to the Foundry Agent Service / Microsoft 365 Agent 365 publishing engineering team.

    I wouldn't keep recreating Foundry resources or switching regions. You've already demonstrated that those changes don't resolve the failure. The remaining question is which backend dependency returns the failure, and that requires Microsoft-side telemetry. The existing request ID should provide a starting point for that investigation.

    rgds,

    Alex

    p.s. if my answer is help - pls mark it as an answer

    Was this answer helpful?

    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.