Azure AI Foundry Agent fails to process uploaded images and logs IMDS (169.254.169.254) connection error

Mohamed, Rihan 60 Reputation points
2026-07-01T14:46:14.9366667+00:00

Hi Team,

I'm working with an Azure AI Foundry agent that uses Azure AI Search as its knowledge source.

The agent works correctly for text-based queries, but when I upload an image and ask questions about its contents, the agent is unable to extract or process any information from the image.

What I've tried

  • Tested with different deployment models (including GPT-5).
  • Tested both Prompt Flow and Hosted Agents.
  • Updated the agent instructions.
  • Verified that the image is uploaded successfully.
  • Reviewed the Application Insights logs.

Error observed in Application Insights


Questions

  1. Is this IMDS (169.254.169.254) connection error expected in Azure AI Foundry, or does it indicate a configuration issue?
  2. Could this error prevent image processing or OCR from working?
  3. Does Azure AI Foundry require Managed Identity or Azure Instance Metadata Service (IMDS) access for image ingestion?
  4. Are there any additional configurations or permissions I should verify for image extraction to work correctly?

Any guidance would be greatly appreciated.

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


Answer accepted by question author
Anshika Varshney 15,625 Reputation points Microsoft External Staff Moderator
2026-07-01T19:16:25.1+00:00

Hello @Mohamed, Rihan

Thank you for sharing the details.

Based on your description, the fact that text-based queries work successfully through Azure AI Search while image-based queries fail suggests that the issue may be related to image understanding or ingestion rather than the Azure AI Search knowledge source itself. The IMDS endpoint (169.254.169.254) is commonly associated with Managed Identity token retrieval, and seeing connection attempts in logs does not necessarily indicate the root cause of the image-processing issue by itself.

A few checks that may help narrow down the problem:

  • Verify that the model being used by the agent supports image/multimodal input and that the image is actually being passed to the model during execution.
  • Review Agent traces and Application Insights logs to determine whether the failure occurs during image upload, image retrieval, tool invocation, or model inference.
  • If Managed Identity is being used, validate that the required permissions are correctly assigned and that authentication-related errors are not appearing elsewhere in the traces. Similar agent scenarios involving Azure AI Search have been impacted by authentication and managed identity configuration issues.
  • Test with a simple image question using a known multimodal model and compare the traces against a successful text-only request to identify where the execution path differs.

Could you also share the exact error message from the Application Insights logs (with sensitive information removed) and confirm which model deployment is being used for image processing?

That would help determine whether this is an image-processing limitation, a permissions issue, or an authentication-related failure.

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

Thankyou!

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Newest
  1. Jerald Felix 18,760 Reputation points Volunteer Moderator
    2026-07-01T15:35:33.1333333+00:00

    Hello Mohamed, Rihan,

    Greetings! Thanks for raising this question in the Q&A forum.

    The IMDS (169.254.169.254) connection error is almost always related to Microsoft Entra ID token acquisition through Managed Identity, not to the image content itself. When your agent's underlying compute or connection tries to authenticate using DefaultAzureCredential (or an equivalent SDK-managed credential chain), it attempts several credential sources in order, and ManagedIdentityCredential is one of the first it tries. If the environment cannot reach IMDS, either because no managed identity is enabled or the network path to the metadata endpoint is blocked, that specific credential attempt fails and logs the connection error you're seeing. Whether this is harmless noise or a real blocker depends entirely on which downstream call is relying on that token.

    I noticed the error block in your post came through empty, so I can't see the exact exception text or correlation ID. Based on the symptom pattern (text queries succeed, image queries fail, IMDS shows up in App Insights), here is the most likely cause and how to confirm it.

    Check which resource actually processes the image. In Foundry Agent Service, image understanding for an uploaded file is typically routed either through the multimodal capability of the deployed chat model (for example GPT-5 with vision input) or through a separate connected resource such as Azure AI Vision or Content Understanding for OCR. Go to Foundry portal > Your project > Connected resources and confirm which resource is wired up for image/document processing.

    Confirm the authentication mode on that connection. Under Connected resources > [resource name] > Authentication, check if it's set to API key or Microsoft Entra ID (managed identity). Only the Entra ID/managed identity path will attempt to reach IMDS. If your AI Search connection uses an API key but the vision/OCR resource is configured for Entra ID, that mismatch explains why text queries (Search-based) succeed while image queries (vision/OCR-based) fail.

    Verify managed identity is actually enabled and has role assignments. Go to Foundry project > Settings > Identity and confirm a system-assigned (or user-assigned) managed identity is turned on. Then in the target resource (Azure AI Services, Computer Vision, or Content Understanding), go to Access control (IAM) and confirm the project's managed identity has at minimum the Cognitive Services User role, or Azure AI User if you're on the newer Foundry RBAC model. A missing role assignment will not stop the IMDS call from happening but will cause the subsequent authorized call to fail with a 401/403 right after.

    Check network restrictions. If your Foundry project or the target Cognitive Services resource sits behind a private endpoint or has public network access disabled, and the hosted agent's compute doesn't have a route to IMDS or to the target resource's private endpoint, the token request or the downstream call will fail. Review Networking on both the Foundry resource and any connected Cognitive Services resource.

    Confirm the model deployment supports vision input in your region. Even with authentication resolved, image processing will silently fail if the specific GPT-5 deployment or SKU you're using doesn't have multimodal input enabled for your subscription and region. Check Foundry portal > Model catalog > Your deployment > Capabilities to confirm vision/image input is listed.

    Capture the full exception. In Application Insights, run this query to pull the complete stack trace and any CorrelationId tied to the failed image request, since that will confirm exactly which SDK call is generating the IMDS attempt.

    traces
    | where timestamp > ago(24h)
    | where message has "169.254.169.254" or message has "IMDS"
    | project timestamp, message, severityLevel, operation_Id, cloud_RoleName
    | order by timestamp desc
    

    To directly answer your four questions: the IMDS error itself is expected behavior when any part of the pipeline uses managed identity based authentication, so it is not inherently a bug, but it does indicate that a token acquisition attempt failed somewhere in that request path. Yes, it can block image processing or OCR if the specific resource handling that step depends on the failed token. Azure AI Foundry does require managed identity or IMDS access only for the connections you've explicitly configured to use Entra ID auth, not universally, so this is a configuration choice rather than a hard platform requirement. And the configuration to verify is the connection authentication type, the RBAC role assignment on the target resource, and network reachability, as outlined in steps 2 through 4 above.

    If you can share the full error text and the CorrelationId from Application Insights, I can help pinpoint the exact failing call. If after these checks the issue persists, please open a support ticket through the Azure portal with the CorrelationId attached, since a persistent IMDS timeout inside a fully managed hosted agent environment (not a customer-managed VM) would point to a platform-side networking issue that needs the Foundry Agent Service team to investigate directly.

    If this answer helps you kindly accept the answer which will help others who have similar questions.

    Best Regards,

    Jerald Felix.

    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.