Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Foundry IQ (Azure AI Search) provides direct indexing and query APIs alongside higher-level knowledge source and knowledge base APIs for managed retrieval. Use the Azure portal, REST APIs, or Azure SDKs to configure these capabilities, or connect agents to knowledge bases in the Microsoft Foundry portal.
Applies to: Blob indexers, File indexers (preview)
By default, an indexer treats the contents of a blob or file as a single search document. If you want a more granular representation in a search index, you can set parsingMode values to create multiple search documents from one blob or file. The parsingMode values that result in many search documents include delimitedText (for CSV), jsonArray or jsonLines (for JSON), or markdown with sub-mode oneToMany for markdown.
When batchSize is null, the parsing mode also affects the default indexer batch size. Batching applies to the search documents produced by parsing, not to a count of source files. See Default indexer batch sizes.
When you use any of these parsing modes, the new search documents that emerge must have unique document keys, and a problem arises in determining where that value comes from. The parent blob has at least one unique value in the form of metadata_storage_path property, but if it contributes that value to more than one search document, the key is no longer unique in the index.
To address this problem, the blob indexer generates an AzureSearch_DocumentKey that uniquely identifies each child search document created from the single blob parent. This article explains how this feature works.
One-to-many document key
A document key identifies each document in an index. The default Blob key mapping uses metadata_storage_path, but the effective key also depends on the parsing mode and mappings. Review the parsed matching-key behavior described in this article rather than assuming that a default mapping always selects the final identity.
In a one-to-many search document scenario, an implicit document key based on metadata_storage_path property isn't possible. As a workaround, Foundry IQ (Azure AI Search) can generate a document key for each individual entity extracted from a blob. The system generates a key called AzureSearch_DocumentKey and adds it to each search document. The indexer keeps track of the "many documents" created from each blob, and can target updates to the search index when source data changes over time.
By default, when no explicit field mappings for the key index field are specified, the AzureSearch_DocumentKey is mapped to it, using the base64Encode field-mapping function.
A generated key or Base64 transformation isn't an authorization boundary. If source content supplies a key, review who can control it and whether other blobs or indexers can use the same value. Uniqueness within one blob isn't sufficient. See Protect document identity and permission provenance.
Oversized blobs produce one metadata-only document
When a Blob indexer uses a one-to-many parsing mode with indexStorageMetadataOnlyForOversizedDocuments set to true, an oversized blob bypasses the content splitter. The indexer emits one metadata-only document, not one document per content row.
That document has no parsed content key or row ordinal. Its raw key source falls back to metadata_storage_path. Existing key transformations, including Base64 encoding, can change the value written to the index key field.
Normal-sized blobs retain their existing key behavior: a configured content-derived key, or the generated AzureSearch_DocumentKey based on the blob path and row ordinal. The following table illustrates a folder containing both sizes. It shows raw key sources, not final encoded index keys.
| Source content | Documents produced | Raw key source |
|---|---|---|
| A normal-sized JSON Lines blob with two rows and generated keys. | Two content documents. | Blob path plus the corresponding row ordinal, such as {blob-path};{row-ordinal}. |
| A normal-sized blob with a configured, unique content key. | One document per parsed row. | The configured content key for each row. |
| An oversized blob with metadata-only fallback enabled. | One metadata-only document. | metadata_storage_path, without a row ordinal. |
Enumeration order doesn't change key selection. A normal-sized blob keeps its content or generated keys whether it appears before or after an oversized blob.
ACL ingestion isn't supported when you combine a one-to-many parsing mode with indexStorageMetadataOnlyForOversizedDocuments. This limitation applies to JSON Lines, JSON arrays, delimited text, and one-to-many Markdown parsing.
If a blob changes from normal-sized to oversized, or from oversized to normal-sized, its key selection changes. Documents stored under the old keys aren't automatically deleted and can retain previous content and ACL values. Don't assume that creating the replacement records removes the old records or their grants. Plan explicit document deletion or an appropriate index rebuild, and preserve the document identity and permission trust boundary.
For the configuration setting and source-size limits, see Handle indexer failures.
Example
Assume an index definition with the following fields:
idtemperaturepressuretimestamp
And your blob container has blobs with the following structure:
Blob1.json
{ "temperature": 100, "pressure": 100, "timestamp": "2024-02-13T00:00:00Z" }
{ "temperature" : 33, "pressure" : 30, "timestamp": "2024-02-14T00:00:00Z" }
Blob2.json
{ "temperature": 1, "pressure": 1, "timestamp": "2023-01-12T00:00:00Z" }
{ "temperature" : 120, "pressure" : 3, "timestamp": "2022-05-11T00:00:00Z" }
When you create an indexer and set the parsingMode to jsonLines - without specifying any explicit field mappings for the key field, the following mapping is applied implicitly.
{
"sourceFieldName" : "AzureSearch_DocumentKey",
"targetFieldName": "id",
"mappingFunction": { "name" : "base64Encode" }
}
This setup results in disambiguated document keys, similar to the following illustration (base64-encoded ID shortened for brevity).
| ID | temperature | pressure | timestamp |
|---|---|---|---|
| aHR0 ... YjEuanNvbjsx | 100 | 100 | 2024-02-13T00:00:00Z |
| aHR0 ... YjEuanNvbjsy | 33 | 30 | 2024-02-14T00:00:00Z |
| aHR0 ... YjIuanNvbjsx | 1 | 1 | 2023-01-12T00:00:00Z |
| aHR0 ... YjIuanNvbjsy | 120 | 3 | 2022-05-11T00:00:00Z |
Custom field mapping for index key field
Assuming the same index definition as the previous example, suppose your blob container has blobs with the following structure:
Blob1.json
recordid, temperature, pressure, timestamp
1, 100, 100,"2024-02-13T00:00:00Z"
2, 33, 30,"2024-02-14T00:00:00Z"
Blob2.json
recordid, temperature, pressure, timestamp
1, 1, 1,"2023-01-12T00:00:00Z"
2, 120, 3,"2022-05-11T00:00:00Z"
When you create an indexer with delimitedText parsingMode, it might feel natural to set up a field-mapping function to the key field as follows:
{
"sourceFieldName" : "recordid",
"targetFieldName": "id"
}
However, this mapping doesn't result in four documents showing up in the index because the recordid field isn't unique across blobs. Hence, we recommend you to make use of the implicit field mapping applied from the AzureSearch_DocumentKey property to the key index field for "one-to-many" parsing modes.
If you do want to set up an explicit field mapping, make sure that the sourceField is distinct for each individual entity across all blobs.
Note
The approach used by AzureSearch_DocumentKey of ensuring uniqueness per extracted entity is subject to change and therefore you shouldn't rely on its value for your application's needs.
Specify the index key field in your data
Assuming the same index definition as the previous example and parsingMode is set to jsonLines without specifying any explicit field mappings so the mappings look like in the first example, suppose your blob container has blobs with the following structure:
These inputs illustrate duplicate keys across blobs, which isn't a recommended configuration for separate records.
Blob1.json
{ "id": "1", "temperature": 100, "pressure": 100, "timestamp": "2024-02-13T00:00:00Z" }
{ "id": "2", "temperature": 33, "pressure": 30, "timestamp": "2024-02-14T00:00:00Z" }
Blob2.json
{ "id": "1", "temperature": 1, "pressure": 1, "timestamp": "2023-01-12T00:00:00Z" }
{ "id": "2", "temperature": 120, "pressure": 3, "timestamp": "2022-05-11T00:00:00Z" }
Each document contains the id field, which you define as the key field in the index. In this situation, the system generates an AzureSearch_DocumentKey for the document, but it doesn't use it as the key. Instead, the value of the id field maps to the key field.
Similar to the previous example, this mapping doesn't result in four documents showing up in the index because the id field isn't unique across blobs. When this situation occurs, any JSON entry that specifies an id causes a merge with the existing document instead of uploading a new one. The index then reflects the latest state of the entry with the specified id.
Limitations
When a document entry in the index is created from a line in a file, as explained in this article, deleting that line from the file doesn't automatically remove the corresponding entry from the index. To delete the document entry, you must manually submit a deletion request to the index using the REST API deletion operation.
Changing key mappings can also leave records under old keys. A generated key, reset, or permission refresh doesn't establish document ownership. Keep key selection under the control of authorized ingestion writers. See Protect document identity and permission provenance.
Next steps
If you aren't already familiar with the basic structure and workflow of blob indexing, you should review Indexing Azure Blob Storage with Foundry IQ first. For more information about parsing modes for different blob content types, review the following articles.