Share via

Invalid Endpoint or Connection Failed issue when Agents is trying to call Azure AI Search Service

Yogesh Dhavale (LTIMindtree Limited) 20 Reputation points Microsoft External Staff
2026-05-25T09:39:35.3+00:00

Hi ,

I am trying to access Azure AI search service but receiving the error as Invalid endpoint or Connection Failed in New Azure AI Foundry AI_Search_error1.png

Azure AI Search
Azure AI Search

An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.


3 answers

Sort by: Most helpful
  1. Karnam Venkata Rajeswari 3,675 Reputation points Microsoft External Staff Moderator
    2026-05-29T21:44:00.64+00:00

    @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 -

    1. Azure AI Search endpoint validation A correct endpoint is essential for successful communication. Expected format: https://<search-service-name>.search.windows.net Validation 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
    2. 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
      Managed Identity authentication:
      • Ensure the managed identity associated with the Foundry project is enabled
      • Assign the required role on Azure AI Search: Search Index Data Reader
    3. 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-01 Header: api-key: <valid-key>
      1. If successful response then service is reachable and functional
      2. Failure indicates endpoint, authentication, or network/DNS issue
    4. 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
    5. 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
      To isolate the cause efficiently:
      • Temporarily enable public network access on Azure AI Search
      • Retest agent execution
      Outcome interpretation:
      • 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

    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.

    Was this answer helpful?

    0 comments No comments

  2. kagiyama yutaka 3,605 Reputation points
    2026-05-25T11:19:01.5733333+00:00

    I think the agent hits “Invalid endpoint or Connection failed” when the Search endpoint URL or the index name doesn’t match what actually exists in the Azure AI Search resource. 

    Was this answer helpful?

    0 comments No comments

  3. AI answer

    2026-05-25T09:40:03.16+00:00

    Use the following checks to resolve the “Invalid endpoint or Connection Failed” error when an Azure AI Foundry agent calls Azure AI Search:

    1. Validate the search service endpoint
    • Ensure the endpoint configured in the agent or tool is the Azure AI Search URL in the form:
      • https://<search-service-name>.search.windows.net
    • If connecting via a Foundry IQ knowledge base MCP endpoint, confirm:
      • search_service_endpoint is exactly the search service URL.
      • knowledge_base_name matches the name of the knowledge base in Azure AI Search.
    1. Verify the index or knowledge base name
    • Confirm the index name or knowledge base name in the agent configuration matches the name in Azure AI Search exactly (case-sensitive).
    • A mismatch will surface as “index not found” or similar connection failures.
    1. Check the project connection configuration
    • Make sure the Azure AI Search project connection in Foundry points to the correct search service endpoint that actually hosts the index.
    • If the connection is pointing to the wrong service or region, the agent will fail to connect.
    1. Fix authentication and authorization
    • If using keyless (managed identity) authentication:
      • Assign the Foundry project’s managed identity the required roles on the search service:
        • Search Index Data Reader (read-only scenarios) or
        • Search Index Data Contributor (if writing to indexes).
    • If using API keys:
      • Confirm the key is valid and enabled on the Azure AI Search resource.
      • Update the connection if keys were rotated.
    1. Handle private network / VNet scenarios
    • If the search service is behind a private virtual network and key-based authentication is configured, switch the connection to Microsoft Entra project managed identity (keyless authentication). Key-based auth isn’t supported with private virtual networking for agents.
    • Ensure the search resource’s network settings allow access from the Foundry agents environment.
    1. Confirm region and endpoint type for Foundry resources
    • When connecting to Foundry or other cognitive resources from Azure AI Search (for example via indexers or skillsets), ensure the endpoint includes a custom subdomain (like https://my-custom-subdomain.services.ai.azure.com) when required.
    • If the Foundry resource is not in the same region as Azure AI Search, use a keyless connection as documented.

    If the error persists after these checks, re-create the project connection in Foundry with the verified endpoint, authentication method, and index/knowledge base names, then test connectivity again.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

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.