You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/search-document-level-access-overview.md
+62-30Lines changed: 62 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure AI Search
4
4
description: Conceptual overview of document-level permissions in Azure AI Search.
5
5
author: gmndrg
6
6
ms.author: gimondra
7
-
ms.date: 05/10/2025
7
+
ms.date: 06/06/2025
8
8
ms.service: azure-ai-search
9
9
ms.topic: conceptual
10
10
ms.custom:
@@ -13,35 +13,70 @@ ms.custom:
13
13
14
14
# Document-level access control in Azure AI Search
15
15
16
-
Azure AI Search offers support for document-level access control, enabling organizations to enforce fine-grained permissions seamlessly, from data ingestion through query execution. This capability is essential for building secure AI agentic systems grounding data, Retrieval-Augmented Generation (RAG) applications, and enterprise search solutions while maintaining compliance and user trust.
16
+
Azure AI Search supports document-level access control, enabling organizations to enforce fine-grained permissions at the document level, from data ingestion through query execution. This capability is essential for building secure AI agentic systems grounding data, Retrieval-Augmented Generation (RAG) applications, and enterprise search solutions that require authorization checks at the document level.
17
17
18
-
Document-level access helps restrict content visibility to authorized users, based on predefined access rules. Azure AI Search supports this functionality through multiple approaches, providing flexibility for integration.
18
+
## Approaches for document-level access control
19
19
20
-
## Feature overview
21
-
22
-
Azure AI Search provides two approaches for document-level access control: native support for permission inheritance (applies to Azure Data Lake Storage (ADLS) Gen2) and security trimming.
20
+
Built-in access control list (ACL) support for Microsoft Entra ID security principles is in preview, available through 2025-05-01-preview REST APIs and in prerelease Azure SDK packages that provide the feature.
21
+
22
+
Security filters are a technique for achieving document-level access control. This approach isn't bound to an API so you can use any version or package.
23
+
24
+
| Approach | Description |
25
+
|----------|-------------|
26
+
| Security filters | String comparison. Your application passes in a user or group identity as a string, which populates a filter on a query, excluding any documents that don't match on the string. |
27
+
| ACLs (preview) | Security principle behind the query token is compared to the permission metadata of documents returned in search results, excluding any documents that don't match on permissions. |
28
+
29
+
## Pattern for security trimming via filters
30
+
31
+
For scenarios where native ACL integration isn't supported, we recommend [security trimming using query filters](search-security-trimming-for-azure-search.md). The pattern includes the following components:
23
32
24
-
### Security trimming via filters
33
+
- Create a string field in the index to store strings of user or group identities.
34
+
- Load the index with source documents that include a field containing the identities.
35
+
- Include a filter expression in your query logic for matching on the string.
36
+
- At query time, get the identity of the caller.
37
+
- Pass in the identity of the caller as the filter string.
25
38
26
-
For scenarios where native ACL and RBAC integration isn't supported, Azure AI Search enables [security trimming using query filters](search-security-trimming-for-azure-search.md). By creating a field in the index to represent user or group identities, you can use the filters to include or exclude documents from query results based on those identities. This approach is useful for systems with custom access models or non-Microsoft Entra-based security frameworks.
39
+
You can use push or pull model APIs. Because this approach is API agnostic, you just need to ensure that the index and query has valid strings for the filtration step.
27
40
28
-
### Native support for POSIX-like ACL permissions (preview)
41
+
This approach is useful for systems with custom access models or non-Microsoft Entra-based security frameworks. For more information this approach, see [Security filters for trimming results in Azure AI Search](search-security-trimming-for-azure-search.md).
29
42
30
-
Through Microsoft Entra ID, the [ADLS Gen2 access control model](/azure/storage/blobs/data-lake-storage-access-control-model) supports both Azure role-based access control (Azure RBAC) and POSIX-like access control lists (ACLs). In Azure AI Search using the newest preview APIs, you can flow these permission through to a search index and queries.
43
+
## Pattern for native support for POSIX-like ACL permissions (preview)
31
44
32
-
ADLS Gen2 provides ACLs in a format that works well for this approach, but you can use any data source that provides permission data in the same format.
45
+
Native support is based on Microsoft Entra ID user and group access IDs affiliated with documents that you want to index. We recommend group access IDs for ease of management. The pattern includes the following components:
46
+
47
+
- Start with documents or files that have ACL assignments.
48
+
-[Enable permission filters](/rest/api/searchservice/indexes/create-or-update?view=rest-searchservice-2025-05-01-preview&preserve-view=true#searchindexpermissionfilteroption) in the index.
49
+
-[Add a permission filter](/rest/api/searchservice/indexes/create-or-update?view=rest-searchservice-2025-05-01-preview&preserve-view=true#permissionfilter) to a string field in an index.
50
+
- Load the index with source documents having associated ACLs.
51
+
- Query the index, [adding `x-ms-query-source-authorization`](/rest/api/searchservice/documents/search-post?view=rest-searchservice-2025-05-01-preview&preserve-view=true#request-headers) in the request header.
52
+
53
+
You can use the push model API, pushing any JSON documents to the search index, where the payload includes a string field providing POSIX-like ACLs for each document.
54
+
55
+
Or, use the pull model (indexer) APIs if the data source is [Azure Data Lake Storage (ADLS) Gen2](/azure/storage/blobs/data-lake-storage-introduction).
33
56
34
-
####Retrieve permissions metadata during data ingestion process
57
+
### Retrieve permissions metadata during data ingestion process
35
58
36
-
Azure AI Search enables you to push document permissions directly into the search index alongside the content, enabling consistent application of access rules at query time. This capability is achieved in two ways:
59
+
How you retrieve permissions varies depending on whether you're pushing a documents payload or using the ADLS Gen2 indexer.
37
60
38
-
- Use the [REST API](/rest/api/searchservice/operation-groups) or supported SDKs to [push documents and their associated permission metadata](search-index-access-control-lists-and-rbac-push-api.md) into the search index. This approach is ideal for systems with [Microsoft Entra](/Entra/fundamentals/what-is-Entra)-based [Access Control Lists (ACLs)](/azure/storage/blobs/data-lake-storage-access-control) and [Role-based access control (RBAC) roles](/azure/role-based-access-control/overview), such as [Azure Data Lake Storage (ADLS) Gen2](/azure/storage/blobs/data-lake-storage-introduction). By embedding ACLs and RBAC container metadata within the index, developers can reduce the need for custom security trimming logic during query execution.
61
+
For the [push model approach](search-index-access-control-lists-and-rbac-push-api.md):
62
+
63
+
1. Use the [2025-05-01 preview REST API](/rest/api/searchservice/documents/?view=rest-searchservice-2025-05-01-preview&preserve-view=true#indexdocumentsresult) or prerelease Azure SDK packages for [Python](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/CHANGELOG.md#1160b12-2025-05-14), [.NET](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/CHANGELOG.md#1170-beta4-2025-05-14), or [Java](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/CHANGELOG.md#1180-beta7-2025-05-16) to push documents and their associated permission metadata into the search index.
39
64
40
-
- For [built-in ADLS Gen2 indexers](search-indexer-access-control-lists-and-role-based-access.md), you can use the preview REST API with the permission filter options to flow existing ACLs and RBAC permissions to your search index. This indexer pulls ACLs and RBAC roles at container level during the data ingestion process, enabling a low/no-code workflow for managing document-level permissions.
65
+
1. Consider using the Microsoft Graph SDK to get group or user IDs.
66
+
67
+
1. Ensure your index schema is also created with a preview or prerelease SDK and that the schema has permission filters.
68
+
69
+
For the [pull model ADLS Gen2 indexer approach](search-indexer-access-control-lists-and-role-based-access.md):
70
+
71
+
1. Use the [2025-05-01 preview REST API](/rest/api/searchservice/documents/?view=rest-searchservice-2025-05-01-preview&preserve-view=true#indexdocumentsresult) or prerelease Azure SDK packages for [Python](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/CHANGELOG.md#1160b12-2025-05-14), [.NET](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/CHANGELOG.md#1170-beta4-2025-05-14), or [Java](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/CHANGELOG.md#1180-beta7-2025-05-16) to create the indexer, index, and data source.
72
+
73
+
1. Verify that files in the directory are secured using the [ADLS Gen2 access control model](/azure/storage/blobs/data-lake-storage-access-control-model).
41
74
42
-
####Enforce document-level permissions at query time
75
+
### Enforce document-level permissions at query time
43
76
44
-
With native [token-based querying](https://aka.ms/azs-query-preserving-permissions), Azure AI Search validates a user's [Microsoft Entra token](/Entra/identity/devices/concept-tokens-microsoft-Entra-id) to enforce ACLs and RBAC roles automatically. This functionality helps trim result sets to include only documents the user is authorized to access. You can achieve automatic trimming by attaching the user's Microsoft Entra token to your query request. For more information, see [Query-Time ACL and RBAC enforcement in Azure AI Search](search-query-access-control-rbac-enforcement.md).
77
+
With native [token-based querying](https://aka.ms/azs-query-preserving-permissions), Azure AI Search validates a user's [Microsoft Entra token](/Entra/identity/devices/concept-tokens-microsoft-Entra-id), trimming result sets to include only documents the user is authorized to access.
78
+
79
+
You can achieve automatic trimming by attaching the user's Microsoft Entra token to your query request. For more information, see [Query-Time ACL and RBAC enforcement in Azure AI Search](search-query-access-control-rbac-enforcement.md).
45
80
46
81
## Benefits of document-level access control
47
82
@@ -51,17 +86,14 @@ By offloading permission enforcement to Azure AI Search, developers can focus on
51
86
52
87
Document-level permissions in Azure AI Search provide a structured framework for enforcing access controls that align with organizational policies. By using Microsoft Entra-based ACLs and RBAC roles, organizations can create systems that support robust compliance and promote trust among users. These built-in capabilities reduce the need for custom coding, offering a standardized approach to document-level security.
53
88
54
-
## Reference documents
55
-
56
-
To help you dive deeper into document-level access control in Azure AI Search, here are more articles and samples:
89
+
## Tutorials and samples
57
90
58
-
| Functionality | Reference | Sample |
59
-
|---|---|---|
60
-
|**Index permissions using Push APIs**|[How to index permissions using REST API](search-index-access-control-lists-and-rbac-push-api.md)|[azure-search-rest-samples/Quickstart-ACL](https://github.com/Azure-Samples/azure-search-rest-samples/tree/main/Quickstart-ACL) or [azure-search-python-samples/Quickstart-Document-Permissions-Push-API](https://github.com/Azure-Samples/azure-search-python-samples/blob/main/Quickstart-Document-Permissions-Push-API)|
61
-
|**Index ADLS Gen2 permissions metadata using built-in indexers**|[How to index permissions using ADLS Gen2 indexer](search-indexer-access-control-lists-and-role-based-access.md) and [Tutorial: Index ADLS Gen2 permissions metadata using an indexer](tutorial-adls-gen2-indexer-acls.md)|[azure-search-python-samples/Quickstart-Document-Permissions-Pull-API](https://github.com/Azure-Samples/azure-search-python-samples/blob/main/Quickstart-Document-Permissions-Pull-API)|
62
-
|**Query using Microsoft Entra token-based permissions**|[How to query using Microsoft Entra token-based permissions](https://aka.ms/azs-query-preserving-permissions)| See previous samples. |
63
-
|**Security trimming via filters**|[Security trimming via filters](search-security-trimming-for-azure-search.md)| Not available. |
64
-
65
-
## Next steps
66
-
67
-
-[Tutorial: Index ADLS Gen2 permissions metadata](tutorial-adls-gen2-indexer-acls.md)
91
+
Take a closer look at document-level access control in Azure AI Search with more articles and samples.
92
+
93
+
-[How to index document-level permissions using push API](search-index-access-control-lists-and-rbac-push-api.md)
94
+
-[How to index document-level permissions using the ADLS Gen2 indexer](search-indexer-access-control-lists-and-role-based-access.md)
95
+
-[How to query using Microsoft Entra token-based permissions](https://aka.ms/azs-query-preserving-permissions)
96
+
-[Tutorial: Index ADLS Gen2 permissions metadata using an indexer](tutorial-adls-gen2-indexer-acls.md)
Copy file name to clipboardExpand all lines: articles/search/search-security-trimming-for-azure-search.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,12 @@ ms.service: azure-ai-search
10
10
ms.custom:
11
11
- ignite-2023
12
12
ms.topic: how-to
13
-
ms.date: 01/15/2025
13
+
ms.date: 06/06/2025
14
14
---
15
15
16
16
# Security filters for trimming results in Azure AI Search
17
17
18
-
Azure AI Search doesn't provide native document-level permissions and can't vary search results based on user identity. As a workaround, you can create a filter that trims search results based on a string containing a group or user identity.
18
+
For search solutions that can't use the [built-in access control list (ACL) support](search-document-level-access-overview.md) for document-level authorization, Azure AI Search supports creating a filter that trims search results based on a string containing a group or user identity.
19
19
20
20
This article describes a pattern for security filtering having the following steps:
0 commit comments