An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
@Yogesh Dhavale (LTIMindtree Limited)
Welcome to Microsoft Q&A .Thank you for reaching out to us.
Thank you for sharing the details of the scenario. The error “Invalid endpoint or Connection Failed” in Azure AI Foundry agents typically indicates that the Azure AI Search tool connection is unable to successfully establish connectivity during execution.
From the observed behavior, the issue occurs at the tool invocation layer, meaning the request does not proceed to query execution in Azure AI Search. This generally points to a misconfiguration or connectivity-related issue involving endpoint configuration, authentication, or network access. However, in certain cases, the behavior may also persist even after validation steps are completed, indicating a dependency on service-level interaction.
Please check if the following helps -
- Azure AI Search endpoint validation A correct endpoint is essential for successful communication. Expected format:
https://<search-service-name>.search.windows.netValidation points:- Must exactly match the endpoint shown in the Azure AI Search overview blade
- Must include HTTPS protocol
- Must not include index names, query paths, or trailing slashes
- Must not use alternative domains or modified URLs
- Authentication configuration validation Azure AI Search supports both API key and Microsoft Entra ID authentication. API Key authentication:
- Ensure a valid Query Key or Admin Key is used
- Confirm the key has not been regenerated or rotated
- Verify no hidden characters or whitespace are present
- Ensure the managed identity associated with the Foundry project is enabled
- Assign the required role on Azure AI Search: Search Index Data Reader
- Direct connectivity test A direct REST API call helps isolate whether the issue is service-level or connectivity-related. Example request:
GET https://<search-service-name>.search.windows.net/indexes?api-version=2023-11-01Header:api-key: <valid-key>- If successful response then service is reachable and functional
- Failure indicates endpoint, authentication, or network/DNS issue
- Azure AI Foundry connection validation In some cases, the issue may originate from a misconfigured or outdated tool connection. Recommended actions are to:
- Remove existing Azure AI Search connection
- Recreate the connection using correct endpoint and authentication
- Rebind the connection to the agent
- Retest execution
- Region and configuration alignment Ensure proper alignment across services:
- Foundry project and Azure AI Search are in compatible regions
- No outbound restrictions are blocking runtime communication
- Network routing and DNS configuration align with the chosen connectivity model
- Temporarily enable public network access on Azure AI Search
- Retest agent execution
- If resolved then issue is related to private networking or DNS
- If not resolved then proceed with endpoint, authentication, or connection validation
The following references might be helpful , please check them out
- Connect an Azure AI Search index to Foundry agents - Microsoft Foundry | Microsoft Learn
- Introduction to Azure AI Search - Azure AI Search | Microsoft Learn
- Connect Using Azure Roles - Azure AI Search | Microsoft Learn
- What is a private endpoint? - Azure Private Link | Microsoft Learn
Please let us know if the response was helpful
Thank you
Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the response was helpful. This will be benefitting other community members who face the same issue.