Issue with connectivity to OpenAI hosted in foundry from search service skill indexer

Kedar Koppolu (Harman Connected Services Inc) 0 Reputation points Microsoft External Staff
2026-07-23T14:13:58.2733333+00:00

Primary Issue: Azure Search indexer fails with 401 Unauthorized error when using AI Foundry project endpoint in AzureOpenAIEmbeddingSkill. The error message indicates "audience is incorrect (https://ai.azure.com)".

 

The same skillset works successfully when using direct Azure OpenAI endpoint (https://{resource}.openai.azure.com), but fails when switching to AI Foundry project endpoint (https://{resource}.services.ai.azure.com/api/projects/{project-name}).

 

Secondary Issue: When I navigating to Foundry project through the new AI foundry experience getting Private network access required even though Ip address added to the network and required roles assigned correctly.

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.


2 answers

Sort by: Most helpful
  1. Venkatesan S 10,830 Reputation points Microsoft External Staff Moderator
    2026-07-23T14:50:24.0166667+00:00

    Hi @Kedar Koppolu (Harman Connected Services Inc) ,

    Thank you for contacting Microsoft Q&A forum

    Based on the behavior you've described, the two issues appear to be separate.

    1.Azure AI Search indexer returns 401 Unauthorized when using the AI Foundry project endpoint

    The error "401 Unauthorized – audience is incorrect (https://ai.azure.com)" indicates that the AzureOpenAIEmbeddingSkill is unable to authenticate when the AI Foundry project endpoint is used as the resourceUri.

    From the current Azure AI Search documentation, the AzureOpenAIEmbeddingSkill supports account-level resource endpoints such as:

    • https://<resource>.openai.azure.com
    • https://<resource>.services.ai.azure.com
    • https://<resource>.cognitiveservices.azure.com

    However, the project-scoped endpoint:

    https://<resource>.services.ai.azure.com/api/projects/<project-name>

    is not listed as a supported endpoint for the embedding skill. Since your skillset works successfully when using the Azure OpenAI resource endpoint and fails only after switching to the AI Foundry project endpoint, this indicates that the issue is related to the endpoint being used rather than the embedding skill itself.

    We recommend the following:

    • Update the resourceUri to use an account-level endpoint (without the /api/projects/<project-name> path).
    • Verify that the embedding model deployment exists on the same Azure AI Foundry/Azure OpenAI resource referenced by the resourceUri.
    • If you're using Microsoft Entra ID (Managed Identity), ensure the Search service identity has the required permissions (such as Cognitive Services User) on the Azure AI resource and allow a few minutes for RBAC propagation before testing again.

    2. "Private network access required" when accessing the AI Foundry project

    This issue is independent of the Search indexer authentication failure and is typically related to the networking configuration of the Azure AI Foundry resource or project.

    Even if your public IP has been added and the appropriate RBAC roles have been assigned, access may still be blocked due to one or more of the following:

    • The resource or project is configured to allow access only through a Private Endpoint.
    • The actual public IP reaching the service differs from the IP that was allow-listed (for example, due to VPN, proxy, or NAT).
    • Private DNS isn't resolving the AI Foundry endpoint correctly when using Private Endpoints.
    • Public Network Access or firewall settings are restricting portal access.

    We recommend reviewing the networking configuration of the Azure AI Foundry resource, confirming whether it is configured for Public Access or Private Endpoint access, verifying the actual client IP reaching the service, and ensuring DNS resolution is configured correctly if private networking is enabled.

    If the issue continues after updating the resourceUri to a supported account-level endpoint, please share the following details so we can investigate further:

    • The sanitized resourceUri configured in the skillset.
    • The embedding model deployment name.
    • Whether authentication is performed using an API key or Managed Identity.
    • A screenshot of the Azure AI Foundry resource Networking configuration.
    • The complete 401 response (including the response body, if available).

    Official documentation:

    Kindly let us know if the above helps or you need further assistance on this issue.

    Please do not forget to 210246-screenshot-2021-12-10-121802.pngand “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Jose Benjamin Solis Nolasco 13,376 Reputation points Volunteer Moderator
    2026-07-23T14:35:33.0666667+00:00

    Welcome to Microsoft Q&A

    Hello @Kedar Koppolu (Harman Connected Services Inc) , I hope you are doing well.

    The two issues may be related to the difference between the Azure OpenAI resource endpoint and the Microsoft Foundry project endpoint.

    For the first issue, the error:

    401 Unauthorized - audience is incorrect (https://ai.azure.com)

    strongly suggests an authentication audience mismatch. The Foundry project endpoint uses Microsoft Entra authentication with the https://ai.azure.com/.default scope, while the Azure OpenAI embeddings API uses the Cognitive Services audience (https://cognitiveservices.azure.com/.default). The Azure AI Search skillset integration may therefore not support using the Foundry project endpoint directly as the AzureOpenAIEmbeddingSkill resource URI in the same way as a direct Azure OpenAI endpoint.

    I would recommend:

    • Use the direct Azure OpenAI resource endpoint (https://<resource>.openai.azure.com) for AzureOpenAIEmbeddingSkill if that is the endpoint supported by the skill configuration.
    • Verify that the embedding model deployment name and API version are correct.
    • If Azure OpenAI has public network access disabled, verify the Azure AI Search managed identity/RBAC and networking configuration. Microsoft documents using managed identity and trusted-service access or a shared private link for Azure AI Search to access a secured Azure OpenAI resource.

    For the secondary Foundry private network issue, if the Foundry project is configured with restricted or private network access, adding your client IP alone may not be sufficient. Microsoft Foundry supports public access from selected IP addresses or private endpoint access, and private endpoint scenarios also require correct DNS resolution and private networking configuration.

    I would therefore troubleshoot these as two separate connectivity/authentication paths: the Search indexer → embedding model path, and your browser/client → Foundry project path. The fact that the direct Azure OpenAI endpoint works is a strong indication that the first issue is specifically related to the Foundry project endpoint and its authentication audience, rather than the model deployment itself.

    References

    If my answer helped you, please consider marking it as accepted. This helps others in the community find similar solutions.This helps others in the community find similar solutions.

    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.