Issue with Azure AI Search RBAC permissions while inside VNET

Ummard, Simon (BDO Lixar) 0 Reputation points
2025-08-18T17:23:24.4+00:00

Subject: Request for Assistance: Azure AI Search 403 Forbidden Issue on Private Endpoint

I'm currently troubleshooting a 403 Forbidden issue occurring on one of my Azure Cognitive Search services and would appreciate help narrowing down the root cause. Here is the current situation:


My Environment

I have two Azure AI Search services:

  1. genai-assistant-dev-search
    • SKU: Basic
    • Public Network Access: Enabled
    • Private Endpoint: Not configured
    • Works without issue.
  2. genai-private-assistant-dev-search

SKU: Standard

Originally deployed with a private endpoint inside a private VNet

Public Network Access: Now Enabled for testing

Private Endpoint: Configured and Approved

  • Shared Private Link Resources: Configured

Returns 403 Forbidden when accessed using the same client setup with RBAC.

  • Works when using the API key it works

Access Configuration

Calls to both search services are being made from an Azure Function.

For both services, I’m using the same user-created managed identity (568xxxx-xxxxxxxx). I’ve confirmed that it has the following roles assigned on both services:

Search Index Data Reader

Search Index Data Contributor

Search Service Contributor

These roles were verified using az role assignment list, and the role assignments are identical between the two services.

For genai-private-assistant-dev-search, if I use the API key, the service functions correctly. However, the same Azure Function code using the managed identity consistently fails with a 403 Forbidden. This reinforces that the problem lies with RBAC- or identity-based access rather than networking or endpoint availability. As a network routing issue would not let the Key work.


My SDK Setup (Python)

I'm using the latest version of the Azure SDKs:

from azure.search.documents import SearchClient
from azure.identity import ManagedIdentityCredential
from azure.search.documents.indexes.models import SearchAudience

client = SearchClient(
    endpoint="https://genai-private-assistant-dev-search.search.windows.net",
    index_name="<index-name>",
    credential=ManagedIdentityCredential(568xxxx-xxxxxxxx)
)

This exact setup works perfectly when switched to genai-assistant-dev-search, but fails with a 403 on genai-private-assistant-dev-search. Comparisons of the indexes have shown them to be the same except for id.


Observations and Theories

  • DNS Resolution: I suspect that DNS resolution inside the VNet environment is resolving the search endpoint to a private IP due to the presence of the private endpoint. and logging showing the resolution internally.

Public Access Still Enabled: However, since public access is not disabled, I would have expected the request to fall back to the public endpoint if the private one was inaccessible.

  • I am getting internal resolution on the IP for routing so the traffic seems to be going to the right place.

Possibly there is an issue authentication the RBAC token from withing the vnet that has caused an issue since setup?


Request

Are there additional diagnostics I can run to identify whether the 403 is truly due to private endpoint access denial or something else?

I’m happy to provide logs, more detailed traces, or try custom testing as needed. Thank you in advance for your assistance!Subject: Request for Assistance: Azure AI Search 403 Forbidden Issue on Private Endpoint

I'm currently troubleshooting a 403 Forbidden issue occurring on one of my Azure Cognitive Search services and would appreciate help narrowing down the root cause. Here is the current situation:


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.


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.