Schedule an indexer in Foundry IQ (Azure AI Search)

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.

Set the schedule property to configure indexers to run on a schedule. Indexer scheduling is useful in situations such as:

  • Source data changes over time, and you want the indexer to automatically process the difference.
  • Source data is very large, and you need a recurring schedule to index all of the content.
  • An index is populated from multiple sources using multiple indexers, and you want to stagger the jobs to reduce conflicts.

Use a recurring schedule to discover new or changed source content. Separately, Search can automatically continue unfinished ingestion after a content-processing execution-time stop. As long as your data source supports change detection, subsequent executions can resume from saved progress.

Once you put an indexer on a schedule, it stays on the schedule until you clear the interval or start time, or set disabled to true. If a scheduled indexer stops triggering unexpectedly, see Scheduling behavior FAQ for recovery steps. Leaving the indexer on a schedule when there's nothing to process doesn't impact system performance. Checking for changed content is a relatively fast operation.

Prerequisites

  • A valid indexer configured with a data source and index.

  • Change detection in the data source. Azure Storage and SharePoint have built-in change detection. For other data sources, such as Azure SQL and Azure Cosmos DB, you must enable change detection manually.

Automatic continuation after an execution-time stop

When a content-processing indexer run reaches its per-run execution-time quota and eligible work remains, Search automatically queues continuation work. This system-generated continuation is separate from the polling schedule you configure.

For example, an indexed knowledge source can poll for changes every 24 hours. If its generated indexer reaches the execution-time quota during initial or incremental ingestion, eligible unfinished work is queued for continuation rather than waiting for the next daily poll. You don't need to shorten the polling interval solely to continue that work.

Continuation goes to the end of the content-processing queue. It isn't an immediate restart, and queue demand can delay execution. The next execution resumes from saved progress rather than resetting the indexer. Work after the last saved checkpoint can be processed again. A large ingestion job can require multiple execution windows.

Previous run outcome What to expect
Execution-time quota reached, with eligible work remaining. Search queues continuation work, subject to queue availability.
Normal completion. No unfinished work needs quota continuation. Future source changes are discovered on the configured schedule.
Cancellation, persistent failure, or invalid configuration. Don't rely on quota continuation to recover. Resolve the cause and use the appropriate run or scheduling procedure.

Continuation doesn't change your configured polling interval or permit two concurrent copies of the same indexer. Scheduled and on-demand requests remain subject to the normal scheduling behavior. Don't repeatedly submit manual runs to bypass the queue.

Automatic continuation doesn't remove execution limits or guarantee a completion time. Repeated failures can result in scheduling backoff. If executions repeatedly stop without making progress, investigate the source, document sizes, and skill processing instead of assuming continuation retries indefinitely until success. See Troubleshoot unfinished ingestion.

Use execution history to monitor quota stops and subsequent progress. The per-run stop described here is different from the service-wide cumulative runtime quota on S3 HD and Serverless services. Continuation doesn't bypass that quota.

Schedule definition

A schedule is part of the indexer definition. If you omit the schedule property, the indexer has no recurring polling schedule; start it on demand. Eligible automatic continuation is separate from configuring recurring polls. The property has two parts.

Property Description
"interval" (required) The amount of time between the start of two consecutive indexer executions. The smallest interval allowed is 5 minutes, and the longest is 1,440 minutes (24 hours). Format it as an XSD "dayTimeDuration" value (a restricted subset of an ISO 8601 duration value).

The pattern for this value is: P(nD)(T(nH)(nM)).

Examples: PT15M for every 15 minutes, PT2H for every two hours.
"startTime" (optional) Specify the start time in coordinated universal time (UTC). If you omit this value, the current time is used. This time can be in the past, in which case the first execution is scheduled as if the indexer has been running continuously since the original start time.

The following example is a schedule that starts on January 1 at midnight and runs every two hours.

{
    "dataSourceName" : "hotels-ds",
    "targetIndexName" : "hotels-idx",
    "schedule" : { "interval" : "PT2H", "startTime" : "2024-01-01T00:00:00Z" }
}

Configure a schedule

Specify schedules in an indexer definition. To set up a schedule, use the Azure portal, REST APIs, or an Azure SDK.

  1. Go to your Foundry IQ service in the Azure portal.
  2. On the left pane, select Indexers.
  3. Open an indexer.
  4. Select Settings.
  5. Scroll down to Schedule, and then choose Hourly, Daily, or Custom to set a specific date, time, or custom interval.

Switch to the Indexer Definition (JSON) tab at the top of the index to view the schedule definition in XSD format.

Scheduling behavior FAQ

Can I run multiple indexer jobs in parallel?

You can run multiple indexers simultaneously, but each indexer is a single instance. You can't run two copies of the same indexer concurrently.

For text-based indexing, the scheduler can start as many indexer jobs as the Foundry IQ service supports, which the number of search units determines. For example, if the service has three replicas and four partitions, you can have 12 indexer jobs in active execution, whether initiated on demand or on a schedule.

For skills-based indexing, indexers run in a specific execution environment. For this reason, the number of service units doesn't affect the number of skills-based indexer jobs you can run. Multiple skills-based indexers can run in parallel, but doing so depends on content processor availability within the execution environment.

Do scheduled jobs always start at the designated time?

Indexer processes can queue up and might not start exactly at the time posted, depending on the processing workload and other factors. For example, if an indexer happens to still be running when its next scheduled execution is set to start, the pending execution is postponed until the next scheduled occurrence, which allows the current job to finish.

To make this behavior more concrete, consider the following example. Suppose you configure an indexer schedule with an interval of hourly and a start time of January 1, 2024 at 8:00:00 AM UTC. Here's what could happen when an indexer run takes longer than an hour:

  1. The first indexer execution starts at or around January 1, 2024 at 8:00 AM UTC. Assume this execution takes 20 minutes (or any amount of time that's less than 1 hour).

  2. The second execution starts at or around January 1, 2024 9:00 AM UTC. Suppose that this execution takes 70 minutes - more than an hour – and it doesn't complete until 10:10 AM UTC.

  3. The third execution is scheduled to start at 10:00 AM UTC, but at that time the previous execution is still running. This scheduled execution is then skipped. The next execution of the indexer doesn't start until 11:00 AM UTC.

In rare cases, such as during maintenance or when recovering from transient conditions, the system queues up multiple indexer runs. When this condition occurs, the indexer executes pending workloads sequentially within the scheduled window. For example, if an indexer is scheduled to run hourly and several runs were delayed or triggered on-demand, those queued up jobs execute back-to-back until the queue is drained. These runs aren't extra runs, but represent previously scheduled or requested executions. While this behavior is uncommon in most scenarios, the indexer is designed to eventually process all queued tasks to maintain consistency and data freshness.

Note

If you have strict indexer execution requirements that are time-sensitive, consider using the push API model so you can control the indexing pipeline directly.

What happens if indexing fails repeatedly on the same document?

If you set an indexer to a certain schedule but it repeatedly fails on the same document each time, the indexer begins running on a less frequent interval (up to the maximum interval of at least once every 2 hours or 24 hours, depending on different implementation factors) until it successfully makes progress again. If you believe you fixed the underlying issue, run the indexer manually. If indexing succeeds, the indexer returns to its regular schedule. If the indexer doesn't return to its regular schedule after a successful manual run, see the next question.

A scheduled indexer stopped triggering. How do I restart its schedule?

Use this procedure when no new runs appear in execution history even though the indexer has a schedule and its data source has changed. A delayed or still-running execution doesn't by itself mean the schedule stopped triggering.

Setting disabled to true suspends scheduled runs. Setting it back to false resumes scheduling, using the current time as the new baseline for the configured interval. Re-enabling the indexer doesn't start a run immediately.

Don't reset the indexer to restart its schedule. Resetting clears the high-water mark and flags all documents for a full overwrite, which can force the indexer to reprocess all your data.

  1. Go to your Foundry IQ service in the Azure portal.
  2. Select Indexers.
  3. Select the indexer to open it.
  4. Select Settings.
  5. Set the indexer to Disabled.
  6. Select Save.
  7. Set the indexer back to Enabled.
  8. Select Save.
  9. Select the Execution history tab and verify that a new run appears within the next scheduled interval.

Note

Re-enabling the indexer resets the schedule relative to the current time, not the original startTime. For example, if the interval is two hours and you re-enable at 3:15 PM, the next scheduled run is at approximately 5:15 PM.

Next steps

For indexers that run on a schedule, you can monitor operations by retrieving status from the Foundry IQ service, or get detailed information by enabling resource logging.