A unified Azure platform for creating and managing AI models, agents, and applications with built‑in enterprise security, monitoring, and governance
Hello @Janžo Jakub ,
Thank you for the detailed diagnostics. Your results point to a DNS problem inside the hosted agent sandbox, not to your agent code or authentication. I couldn't find any published advisory, known issue or documented change to hosted agent DNS behavior for Sweden Central.
Why only the Foundry hostname fails
[Errno -3] Temporary failure in name resolution means the DNS server inside the sandbox didn't return an answer at all. It doesn't mean the name doesn't exist. Because your Foundry resource has an approved Private Endpoint, the public name <resource>.services.ai.azure.com redirects (through a CNAME) to <resource>.privatelink.services.ai.azure.com. If the sandbox can't follow that redirect, the Foundry hostname fails while other hostnames, such as Azure API Management, still resolve.
Having a Private Endpoint while public access is enabled is a supported setup and shouldn't cause this error on its own. Your agent isn't VNet-injected, so it doesn't use your privatelink.services.ai.azure.com Private DNS Zone and should resolve the public endpoint.
Recommended steps
- Confirm the toolbox endpoint. Make sure
FoundryToolboxuses the public hostname in the documented format, not theprivatelinkhostname:https://<account>.services.ai.azure.com/api/projects/<project>/toolboxes/<toolbox-name>/mcp?api-version=v1 - Narrow down the failure inside the container:
import socket
print(open("/etc/resolv.conf").read())
for h in ["<resource>.services.ai.azure.com",
"<resource>.privatelink.services.ai.azure.com",
"<resource>.cognitiveservices.azure.com"]:
try:
print(h, socket.getaddrinfo(h, 443))
except Exception as e:
print(h, "FAILED", e)
If only the services.ai.azure.com or privatelink names fail, the sandbox can't follow the Private Link redirect.
Optional isolation test. If your security policy allows it, test the same agent against a non-production Foundry resource that has no Private Endpoint. If DNS resolution works there, the Private Link redirect path is confirmed as the trigger.
Open an Azure support request under Microsoft Foundry > Agent Service. Include:
- Region
- Agent name and version
- Affected session IDs
- UTC timestamps of failed runs
- Sanitized diagnostic output
- Last working date (October 20) and the date failures started (October 26)
- Sanitized diagnostic output
- UTC timestamps of failed runs
- Affected session IDs
- Agent name and version
The VNet-injection thread you linked describes a brief DNS delay just after the sandbox starts. Your failure is persistent and happens without VNet injection, so adding startup retries or DNS warm-up won't fix it.
References
- Use a toolbox with a hosted agent
- Network isolation for a toolbox
- Configure network isolation for Microsoft Foundry
- Set up private networking for Foundry Agent Service
If this answer helped, please let me know.
Thank you.