Microsoft Foundry hosted agent loses pasted image from Teams — request.input coerced to string instead of list

Mohamed, Rihan 40 Reputation points
2026-06-29T09:47:38.9433333+00:00

Issue Summary

When a user pastes an image + types a question in Microsoft Teams and sends it

to a Foundry-hosted agent, the agent never receives the image. It always

responds with:

"I don't see an image attached to your message."

This happens even when the image and the question are sent in the same

Teams message.


Environment

| Item | Value |

|---|---|

| Platform | Microsoft Teams → Foundry Hosted Agent |

| SDK | agent_framework_foundry_hosting / azure-ai-agentserver |

| API | Responses API (ResponsesHostServer) |

| Image method | Ctrl+V clipboard paste (PNG/JPG) |


What We See in the Agent Handler

At the very beginning of the handler, we log request.input.

Expected — input should be a list containing both the image and the text:

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

0 comments No comments

1 answer

Sort by: Most helpful
  1. Sina Salam 30,646 Reputation points Volunteer Moderator
    2026-06-29T13:09:59.49+00:00

    Hello Mohamed, Rihan,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that your Microsoft Foundry hosted agent loses pasted image from Teams — request.input coerced to string instead of list.

    What really went wrong is that the image is missing before the model call. Microsoft documents that Teams bots receive uploaded files and inline images through message activity attachments, and the bot must retrieve the file/image content from the provided metadata or download URL. - https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bots-filesv4, https://learn.microsoft.com/en-us/samples/officedev/microsoft-teams-samples/officedev-microsoft-teams-samples-bot-file-upload-nodejs/

    You can resolve this:

    • Do not depend on the direct Foundry “Publish to Teams/M365” path for pasted image ingestion until Microsoft confirms support for this exact attachment-to-input_image conversion.
    • Create a custom Teams/Microsoft 365 agent front end.
    • Enable file support in the Teams app manifest.
    • Read the incoming Teams activity attachments.
    • Download the pasted or inline image.
    • Send the text and image together to Azure OpenAI Responses API / Foundry model using a valid multimodal payload.

    After implementing this adapter layer, the image is passed explicitly to the model as input_image, and the agent can answer image-based questions reliably. Azure OpenAI Responses API supports text and image inputs, while Microsoft 365 Agents Toolkit is the recommended path for building Teams/M365 agents that integrate with Azure AI Foundry.

    Use the associated official Microsoft resources for implementation:

    I hope this is helpful. Please! Do not hesitate to let me know if you have any other questions, steps or clarifications.


    Please do not close the thread by upvoting and accepting the answer if any part of it is helpful.

    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.