Why does the indexer failure message delay with the authentication code sometimes, and how to retrieve the authentication code?

ToddCrappa-8660 5 Reputation points
2024-09-05T15:39:57.53+00:00

I have a Web App that uses data I have on a SharePoint site, to allow users to ask questions about. Sometimes when I run my indexer, after loading new data files on my SharePoint site, the process will fail and it will show me the failure on my screen. I can then retrieve the authentication code and use it to log in, then rerun the indexer and it works fine.

Other times, it will fail, but the failure does not show up on my screen until after the authentication code expires and it does not allow me to run the indexer.

When it fails to show up on my screen, where can I go look for the authentication code other than on the application screen under the indexer?

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 39,106 Reputation points Volunteer Moderator
    2025-10-20T19:03:59.2066667+00:00

    Hello !

    Thank you for posting on Microsoft Learn Q&A.

    The delay happens because the indexer keeps retrying the SharePoint auth step and the portal UI isn't real time. By the time the failure finally surfaces in the blade, the device code may have expired.

    https://free.blessedness.top/en-us/azure/search/search-monitor-indexers

    You can always pull the current device login code from the indexer status API it’s embedded in the errorMessage of the latest run.

    https://free.blessedness.top/en-us/azure/search/search-how-to-index-sharepoint-online

    You can go for REST which works for portal created indexers too :

    GET https://<your-service>.search.windows.net/indexers/<your-indexer-name>/status?api-version=2025-08-01-preview
    api-key: <admin key>
    

    Look in the JSON at lastResult.errors[*].errorMessage, it contains the device login URL and the device code to enter.

    https://free.blessedness.top/en-us/azure/search/search-how-to-index-sharepoint-online

    If you want to check in the portal, go to the search service, then go to your indexers and under the status open the latest run and check the error details (they include the device code). https://free.blessedness.top/en-us/azure/search/search-monitor-indexers

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.