A fully managed platform in Microsoft Foundry for hosting, scaling, and securing AI agents built with any supported framework or model
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_imageconversion. - 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:
- Publish agents to Microsoft 365 Copilot and Microsoft Teams
- Hosted agents in Foundry Agent Service
- Use the Azure OpenAI Responses API
- Create a model response — Responses API reference
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.