Regression in Azure AI Search Elevated Read Access: App-Only Tokens No Longer Supported with x-ms-enable-elevated-read Header

Open
#49,507 3 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
18/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
azure, python

Research direction

The failing call is search_client.search(...) with a headers={"x-ms-enable-elevated-read": "true"} argument, using a service principal credential; the service error is quoted in the issue body. Start by reproducing the call with an app-only credential and checking how the SDK's search client passes custom headers and credentials. Done means the team has decided whether the SDK should change or the docs should state that elevated read requires a user token, and the reporter's workaround is confirmed.

Written by the indexing model from the issue text.

Description

Client customer-reported needs-team-attention question Search Service Attention
search_results = search_client.search(
    search_text="",
    filter=f"artefact_id eq '{artefact_id.lower()}'",
    select=["id"],
    top=100,
    headers={"x-ms-enable-elevated-read": "true"},
)

We are experiencing a regression/change in behavior when using Azure AI Search elevated read access.

Previously, our application was able to successfully query documents from an Azure AI Search index using the x-ms-enable-elevated-read header while authenticating through a service principal (app-only authentication). This capability was being used to retrieve existing indexed documents, including records that contain user permission restrictions, so that stale entries could be identified and deleted before re-ingestion.

ERROR : azure.core.exceptions.HttpResponseError:
Header 'x-ms-enable-elevated-read' requires an AAD user access token.
App-only tokens are not supported.

Code:
Message: Header 'x-ms-enable-elevated-read' requires an AAD user access token.
App-only tokens are not supported.

Due to this behavior change:

1] Existing documents with restricted permissions cannot be retrieved using elevated read access.
2] The ingestion process cannot reliably identify and delete previously indexed documents.
3] Duplicate or stale documents may remain in the index.
4] Automated synchronization between source repositories and Azure AI Search is impacted.

Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 22h
Merged PRs (30d)
189

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/azure-sdk-for-python

All issues in Azure/azure-sdk-for-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.