An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
Hello Sandesh Poudel,
Thank you for sharing the details and the error message.
Based on what you’ve provided, the key issue appears to be that the Foundry agent is unable to resolve the DNS name of your Azure AI Search service, rather than a problem with authentication or permissions.
The specific error “DNS server returned answer with no data” indicates that the request is failing at the DNS resolution stage, before it even attempts to connect to the service.
What this typically means
When the agent tries to reach your Search endpoint it is not able to resolve this hostname to an IP address. This is usually caused by a network or DNS configuration issue, most commonly related to Private Endpoints or custom DNS settings.
Most likely cause
From experience, the most common scenario is:
- The Azure AI Search service was previously configured with a Private Endpoint
- A Private DNS zone (privatelink.search.windows.net) is still linked
- Even after enabling public access, DNS continues to resolve the service to a private IP
Since Foundry agents are not deployed داخل your VNet, they cannot reach private IP addresses, which results in the DNS failure you are seeing.
Recommended steps to resolve
- Validate Azure AI Search networking configuration
In the Azure portal:
Go to your Azure AI Search resource - Networking
Ensure:
- Public network access = Enabled
- Access configuration = All networks (for testing purposes)
- Enable “Allow Azure services and resources to access this service” (important for Entra ID scenarios)
- Check for Private Endpoint and DNS configuration
If your service previously used Private Endpoint:
- Review Private Endpoint connections
- Check if a Private DNS zone (
privatelink.search.windows.net) is still linked
If so, you have two options:
- Remove the Private Endpoint (simplest approach), or
- Unlink/update the Private DNS zone so the service resolves to a public IP
If this step is skipped, DNS may continue resolving to a private address even though public access is enabled.
- Validate DNS resolution
From a test environment (local machine or Azure VM)
Expected result A public IP address
If you see A private IP (10.x, 172.x, 192.168.x), or No IP returned
then this confirms a DNS configuration issue.
4. Verify Foundry outbound connectivity
what You’ve already set which is correct.
Additionally, if your Foundry workspace is deployed in a VNet:
- Ensure NSGs allow outbound traffic
- Check that UDRs are not forcing traffic through a blocked path
- If using custom DNS servers, confirm they correctly resolve the Search endpoint
- Verify the endpoint in Foundry connection
In your Foundry project:
Confirm the endpoint is exactly:
Ensure there are:
- No typos
- No private endpoint URLs
- No additional suffixes
Also verify that the index name matches exactly
6. Recreate the connection in Foundry
After making any network/DNS changes:
- Delete the existing Azure AI Search connection
- Recreate it
This is important because connection metadata (including DNS resolution) may be cached.
7. Validate authentication and RBAC
Once DNS and connectivity are confirmed:
Use Microsoft Entra ID authentication in the connection
Assign the following roles to the Foundry project’s managed identity:
- Search Index Data Contributor
- Search Service Contributor (if required)
At this point, the behavior strongly indicates a DNS resolution problem, most likely caused by Private Endpoint or DNS configuration still directing traffic to a private IP.
Once the service resolves to a public IP and outbound connectivity is allowed, the Foundry agent should be able to connect successfully.
Connect an Azure AI Search index to Foundry agents (troubleshooting table): https://learn.microsoft.com/azure/foundry/agents/how-to/tools/ai-search#troubleshooting
AI Search Readiness overview: https://supportability.visualstudio.com/AzureDev/_wiki/wikis/AzureDev/1494270/[SB]_Azure_Search/Training/AI_Search_Readiness
I Hope this helps. Do let me know if you have any further queries.
Thank you!