Stage 3, Validate ingestion
At a glance
| Start state | End state | Fallback baseline |
|---|---|---|
| A data source and indexer that Stage 2's Import data wizard already created and ran once | Verified field mappings and a confirmed successful run | Re-run the Stage 2 wizard |
Learning goals
- Understand what a data source and an indexer do, and how the wizard connected storage to your index by managed identity, with no key.
- Verify field mappings, especially the
createdAttodaterename, and fix any the wizard got wrong. - Confirm the indexer's run succeeded and your index contains the archive; reset and rerun if you make a fix.
Why it matters
Manual uploads do not scale, and doing ingestion by identity means no secret ever touches your workflow. The Import data wizard is convenient, but you still need to know exactly what it built: a data source that reads by managed identity, and an indexer whose field mappings decide what ends up in your index. Reading these resources back is the same skill you need when a wizard-built pipeline in a real project needs debugging.
What you will build
Nothing new. You open the tNN-pNN-corporate-index-datasource and tNN-pNN-corporate-index-indexer that Stage 2's wizard created, confirm they are configured the way you expect, and fix or rerun anything that is not.
Knowledge-share outline
- What a data source and an indexer do, and how they connect storage to your index.
- Why the connection uses the Search service managed identity (the
ResourceId=form), not an account key: you receive no storage credentials at all. - Field mappings: confirming each archive field landed in the right index field, including the
createdAttodaterename you made on Stage 2's Preview mappings step.
Lab steps
1. Inspect the data source
On your Search service, select Data sources, then open tNN-pNN-corporate-index-datasource.
Confirm the type is Azure Blob Storage and the container is archive. Select Edit JSON to see the identity-based connection the wizard wrote. Notice there is no account key:
{
"name": "tNN-pNN-corporate-index-datasource",
"type": "azureblob",
"credentials": { "connectionString": "ResourceId=<shared storage resource id>;" },
"container": { "name": "archive" }
}Reference copy: definitions/datasource.template.json.
2. Inspect the indexer's field mappings
Select Indexers, open tNN-pNN-corporate-index-indexer, and select Edit JSON to see its fieldMappings. The wizard mapped every same-named field automatically, and added explicit mappings for the two you renamed in Stage 2:
| Source (blob JSON) | Target (index field) |
|---|---|
id | recordId |
recordType | recordType |
branch | branch |
department | department |
createdAt | date |
subject | subject |
content | content |
If any row is missing, most likely createdAt -> date (this happens if you left the field named createdAt in Stage 2 instead of renaming it), add it here: source field name createdAt, target field name date.
Also confirm the parsing mode under parameters.configuration reads "jsonArray"; that comes from the parsing mode you set on the wizard's connect-to-data step in Stage 2.
Reference copy: definitions/indexer.template.json.
3. Confirm the run, or reset and rerun
Open the indexer's execution history. It should already show Success with 132 documents succeeded (the full archive) from the run the wizard triggered on submit. If you changed a field mapping just now, select Reset, then Run, so every record is reprocessed with the corrected mapping.
While you're here, open the indexer's Schedule setting (the same Schedule indexing control from Stage 2's Advanced settings step) and note it's set to Once: this run was a one-off, on demand. In a real project you would change this to a recurring interval (hourly, daily, or custom) so the indexer keeps picking up new or changed blobs automatically instead of you triggering every run by hand. Leave it on Once for this workshop; there is nothing to change here.
4. Try a query in Search explorer
Select Indexes in the left-hand navigation, then click on tNN-pNN-corporate-index to open it. On the index's overview page, select Search explorer, then View > JSON view. Replace the whole request with this unfiltered query, then select Search:
{
"search": "*",
"queryType": "simple",
"count": true,
"top": 5
}Search explorer returns one page of results, not the whole index, so do not count the rows. Add "count": true as above to ask the service how many documents actually matched, and read the @odata.count at the top of the response; it should say 132, even though "top": 5 limits the returned records to five.
The search bar accepts search text, not URL parameters
The default Query view bar treats its input as search text, not as REST query parameters, so pasting a URL query string can return a small set of matches instead of the whole archive. Use JSON view for every workshop query, setting parameters such as count, filter, and orderby as JSON properties.
For this count check, replace the whole JSON request, including any existing semantic options, filters, or vector queries. "queryType": "simple" keeps the request a plain match-all query.
If this JSON request still returns an @odata.count below 132, follow Fewer documents than expected below before recreating anything.
Expected output
The indexer's last run shows Success with 132 documents succeeded, and your index reports a document count of 132. A quick query in Search explorer returns records. A document count of 1 instead of 132 is not a smaller success, it's the key-conflict error scenario from step 4 of Stage 2 (every record overwrote the last); see Troubleshooting below.
Checkpoint
ingestion-ready: Your indexer's last execution status is Success, the index document count is 132, and a simple query returns archive records.
Fallback baseline
This stage builds nothing, so there is nothing of its own to restore. If the previous stage left you without a working data source, indexer, or populated index, the fastest fix is to re-run Stage 2's Import data wizard: it recreates all three in one pass and runs the indexer immediately. Delete any half-built objects under your own namespace first, so the wizard does not trip over an existing name.
If you would rather restore from the version-controlled definitions than re-run the wizard, ask your facilitator: they have the shared storage resource id the data source needs, which you are deliberately not given.
Troubleshooting
Fewer documents than expected
The Documents total on the index overview and @odata.count measure different things: the former is the index's reported size, while the latter counts matches for the current query. If Documents shows 132 but the query returns 4 or 24, check the query first. A search for a word should return only matching records; it is not an archive-count check.
- Confirm you are querying your own
tNN-pNN-corporate-indexon the correct team Search service. Replace the entire request in JSON view with Step 4's JSON to remove any previous search terms or filters. Read@odata.count, not the number of returned rows. - Open
tNN-pNN-corporate-index-indexer. Confirm itstargetIndexNameis that index and itsdataSourceNameis your archive data source. If the run is still in progress, wait for it to finish and repeat the query. If it has finished, inspect its processed/failed counts and individual errors and warnings; Success alone does not prove 132 distinct records landed. - If a full run processed only 24 records, check the data source's container is
archiveand thatcontainer.queryis absent or empty (no blob-name prefix restriction). Ask the facilitator to verify the uploadedcorporate-archive.jsoncontains the full 132-record array, not a smaller or older dataset. The version-controlled sample has 15, not 24. - If a full run processed 132 records but the unfiltered count remains 24, inspect the index key and the indexer's field mappings.
recordIdmust be the key, mapped from sourceid; repeated key values overwrite earlier documents. Check for failed records too, rather than assuming every processed record was stored. - After correcting the source or mappings, select Reset, then Run, wait for completion, and repeat Step 4. Reset makes unchanged blobs eligible for reprocessing; it does not delete existing index documents. Recreate the index only if its key field or another immutable schema setting is wrong.
Other issues
- Indexer fails with a permissions error. The Search service identity may not yet have Storage Blob Data Reader on the container, or the assignment is still propagating. Wait a minute and rerun. You never fix this with a key.
- Zero documents indexed. Check the parsing mode in the indexer's Edit JSON view is
jsonArray; a single JSON array file needs that, not the default. - A field is empty in results. Check the field mapping;
createdAtmust map todate, and names are case-sensitive. - The wizard guessed the wrong type for
date. Ifdateshows asEdm.Stringinstead ofEdm.DateTimeOffset, go back to the index and fix the field type, then reset and rerun the indexer. - Document count is 1 instead of 132. The index key is mapped from
metadata_storage_pathinstead ofrecordId; every record in the archive's JSON array shares the same blob path, so each one overwrote the last. There is no fix after the fact: delete the indexer, index, and data source, then redo Stage 2's wizard, making surerecordIdcarries the key icon before you select Create.
Optional stretch
Open the indexer's execution history and read the per-run item counts. Understanding run history helps in Stage 5 when you reset and rerun. Not required to proceed.
What we will not cover
- Incremental change detection and high-water-mark policies (the corpus is small and static).
- Scheduled indexer runs; you run on demand in this workshop.