Azure AI search using postman can't create indexer for Sharepoint Document library

mpoland@cargas.com 0 Reputation points
2025-05-07T20:05:36.9533333+00:00

I am setting up an indexer for our sharepoint library to interact with Azure AI Search. I have followed this guide https://learn.microsoft.com/en-us/azure/search/search-howto-index-sharepoint-online, creating an app registration, creating the api permissions for application based (application -files.read.all & sites.read.all) and granted admin permission. I am using postman and all other variables from the app registration and sharepoint url and library have been input. I create create a sharepoint data source and index in postman and can see them in the ai search service. I get the following error when trying to create an indexer using the post request. The sharepoint library url ends in .aspx which in the documentation says it isn't supported but I don't know how to get the document library url in non .aspx format. any suggestions?

Error with data source: Code: invalidRequest\r\nMessage: Share url does not point to a drive item or no permission to access it\r\nClientRequestId: a6db9b54-d35a-4771-9de1-ba48cc300759\r\n  Please adjust your data source definition in order to proceed."
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.
1,339 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Azar 29,520 Reputation points MVP Volunteer Moderator
    2025-05-07T20:29:22.3333333+00:00

    Hi there ******@cargas.com

    Thanks for using QandA platform

    With the SharePoint URL if it ends in .aspx, it’s pointing to a web page, not the actual document library drive. AI Search expects a URL to the drive, not the site UI.

    try this:

    Open the document library in SharePoint.

    1. open Library settings.

    Then look at the URL — it should include /sites/[sitename]/_layouts/15/start.aspx#/Shared Documents, etc.

    Replace that with: https://[tenant].sharepoint.com/sites/[sitename]/_api/v2.0/sites/[site-id]/drives

    You’ll need the driveId from there and use it in the data source.

    Also, confirm the app has access to the exact document library not juz site]

    If this helps kindly comment if answer helps. thanks much.

    0 comments No comments

  2. Suresh Chikkam 2,135 Reputation points Microsoft External Staff Moderator
    2025-05-08T11:26:25.4166667+00:00

    Hi @******@cargas.com,

    Instead of using the visible URL from the browser (which often ends in .aspx and points to the UI), Azure Search needs to connect to the actual storage layer of the document library which is exposed as a drive in Microsoft Graph. The key is to work with the driveId, which uniquely identifies the document library behind the scenes.

    To fetch this driveId, you can use the Microsoft Graph API. First, find the internal site ID for your SharePoint site. Then, query for the drives within that site to get the correct ID for the document library. Once you have that, use it in the data source definition with "query": "driveId='<your-drive-id>'".

    Hope it helps!


    Please do not forget to click "Accept the answer” and Yes wherever the information provided helps you, this can be beneficial to other community members.

    User's image

    If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.


Your answer

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