You can connect SharePoint Online to your Agentspace search app and search over your SharePoint data.
This page describes the following types of SharePoint connectors:
SharePoint: Connects SharePoint Online, ingests data from your SharePoint site, and indexes the SharePoint data. See Connect SharePoint Online and ingest data.
SharePoint Federated (Preview): Sends user queries to the SharePoint search API and enables searching SharePoint data without first ingesting and indexing all the data into Agentspace. See Use federated search with SharePoint.
Connect SharePoint Online and ingest data
This section describes the authentication methods and the procedure to create a SharePoint Online connector in Agentspace and ingest data from your SharePoint Online sites.
Before you begin
To enforce data source access control and secure data in Agentspace, ensure that you have configured your identity provider.
About Entra application registration
Before you can create the connector in Agentspace, you must set up an Entra application registration to enable secure access to SharePoint. How you register the application depends on the authentication method that you select when you're creating the connector in Agentspace. You can choose one of the following methods:
-
Allows Google to securely access SharePoint using cryptographically signed tokens, avoiding the need for a real user principal.
Requires a subject ID to register the Agentspace in Entra. This is available when you create the SharePoint connector in Agentspace.
When you register your app in Entra, you must gather the following details:
- Instance URI:
- For all first-level sites:
https://DOMAIN_OR_SERVER.sharepoint.com
—for example,mydomain.sharepoint.com
. - For a single site:
https://DOMAIN_OR_SERVER.sharepoint.com/[sites/]WEBSITE
—for example,mydomain.sharepoint.com/sites/sample-site
.
- For all first-level sites:
- Tenant ID
- Client ID
These details are necessary to complete the authentication and create the SharePoint connector in Agentspace.
- Instance URI:
Google recommends that you use this method.
-
Gives a granular control over who connects to the SharePoint API.
When you register your app in Entra, you must gather the following details:
- Instance URI: This is in the following form:
- For all first-level sites:
https://DOMAIN_OR_SERVER.sharepoint.com
—for example,mydomain.sharepoint.com
. - For a single site:
https://DOMAIN_OR_SERVER.sharepoint.com/[sites/]WEBSITE
—for example,mydomain.sharepoint.com/sites/sample-site
.
- For all first-level sites:
- Tenant ID
- Client ID
- Client secret
These details are necessary to complete the authentication and create the SharePoint connector in Agentspace.
- Instance URI: This is in the following form:
The authentication process includes signing in to your SharePoint account.
This method is suitable when your SharePoint set up requires a two-factor authentication.
Requires you to create a new SharePoint user, which might add licensing costs.
-
Gives a granular control over who connects to the SharePoint API.
When you register your app in Entra, you must gather the following details:
- Instance URI: This is in the following form:
- For all first-level sites:
https://DOMAIN_OR_SERVER.sharepoint.com
—for example,mydomain.sharepoint.com
. - For a single site:
https://DOMAIN_OR_SERVER.sharepoint.com/[sites/]WEBSITE
—for example,mydomain.sharepoint.com/sites/sample-site
.
- For all first-level sites:
- Tenant ID
- Client ID
- Client secret
These details are necessary to complete the authentication and create the SharePoint connector in Agentspace.
- Instance URI: This is in the following form:
The authentication process includes providing your Entra admin-provided username and password.
This method is suitable when your SharePoint set up doesn't require a two-factor authentication.
Requires you to create a new SharePoint user, which might add licensing costs.
Important considerations when granting SharePoint permissions
Google strongly recommends and uses the principle of least privilege to assign only the permissions necessary to complete a given task. For more information about Google's recommended best practices, see Use IAM securely.
However, to successfully register your application in Microsoft Entra and
create a SharePoint connector in Agentspace, you must
grant full control over all sites or full control over selected sites.
This might seem like an excessive permission.
The reason is that the Sites.Read.All
permission doesn't allow
Agentspace to obtain the SharePoint user groups and role
assignments, whereas Sites.FullControl.All
and Sites.Selected
with
fullcontrol
do.
Considering this, when you configure your connector in Agentspace, you can do the following to restrict what the connector can and can't access:
- Provide a specific instance URI that limits access to a single site
- Select specific entities within the site that you want to sync.
If you have any further concerns over the required permissions, Google recommends that you reach out to Microsoft support.
Set up federated credentials
Use the following steps to configure the app registration, grant permissions, and establish authentication. Google recommends that you use the federated credentials method.
Some common error messages that you might encounter during this process are listed in Error messages.
Obtain service account client ID:
- In the Google Cloud console, go to the Agentspace page.
- In the navigation menu, click Data stores.
- Click Create data store.
- On the Select a data source page, scroll or search for SharePoint Online to connect your third-party source.
- Note the Subject identifier. Don't click Continue yet.
Perform the next steps in this task and then complete the steps in
the Google Cloud console by following the instructions in
Create a SharePoint Online connector.
Note the subject ID but don't click Continue yet
Register app in Microsoft Entra:
- Navigate to Microsoft Entra admin center.
- In the menu, expand the Applications section and select App registrations.
- On the App registrations page, select New registration.
Register a new app in Microsoft Entra admin center Create an app registration on the Register an application page:
- In the Supported account types section, select Accounts in the organizational directory only.
- In the Redirect URI section, select Web and enter the redirect
URI as
https://vertexaisearch.cloud.google.com/console/oauth/sharepoint_oauth.html
- Keep other settings default and click Register.
Select the account type and enter the redirect URI
Note the Client ID and Tenant ID.
App details page
Add federated credentials:
Go to Certificates & secrets > Federated credentials > Add credential.
Add federated credentials in Microsoft Entra Use the following settings:
- Federated credential scenario: Other issuer
- Issuer:
https://accounts.google.com
- Subject identifier: Use the value of Subject identifier that you noted in Google Cloud console in Step 1.a.v.
- Name: Provide a unique name.
Click Add to grant access.
Connect your Google Account to Microsoft Entra ID
Set API permissions.
Select the app to set API permissions Add and grant the following Microsoft Graph permissions. You can choose between the site control options (
Sites.FullControl.All
andSites.Selected
) and profile reading options (User.Read.All
andUser.ReadBasic.All
):Microsoft Graph permissions for federated credentials
Permission Type Description Justification GroupMember.Read.All
Application Read all group memberships This permission allows Agentspace to understand the memberships of the user groups in the SharePoint site. User.Read
Delegated Sign in and read user's profile This is a default permission that must not be removed. When removed, SharePoint displays an error asking you to reinstate this permission.
Site control options Option 1: Sites.FullControl.All
Application Full control over all sites This permission allows Agentspace to obtain the SharePoint user groups and role assignments, which aren't included in the
Sites.Read.All
permission. It also allows Agentspace to index documents, events, comments, attachments, and files across all SharePoint sites.If giving full control over all sites seems excessive, use Option 2:
Sites.Selected
to give granular control.Option 2: Sites.Selected
Application Control over selected sites This permission allows Agentspace to obtain the SharePoint user groups and role assignments, which aren't included in the
Sites.Read.All
permission. It also allows Agentspace to index documents, events, comments, attachments, and files across selected SharePoint sites. This permission provides more granular control instead ofSites.FullControl.All
Profile reading options Option 1: User.Read.All
Application Read all users' full profiles This permission allows Agentspace to understand the data access control for your SharePoint content. Option 2: User.ReadBasic.All
Application Read all users' basic profiles This permission allows Agentspace to understand the data access control for your SharePoint content. Add and grant the following SharePoint permissions. You can choose between
Sites.FullControl.All
andSites.Selected
:SharePoint permissions for federated credentials
Permission Type Description Justification Option 1: Sites.FullControl.All
Application Full control over all sites This permission allows Agentspace to obtain the SharePoint user groups and role assignments, which aren't included in the
Sites.Read.All
permission. It also allows Agentspace to index documents, events, comments, attachments, and files across all SharePoint sites.If giving full control over all sites seems excessive, use Option 2:
Sites.Selected
to give granular control.Option 2: Sites.Selected
Application Control over selected sites This permission allows Agentspace to obtain the SharePoint user groups and role assignments, which aren't included in the Sites.Read.All
permission. It also allows Agentspace to index documents, events, comments, attachments, and files across selected SharePoint sites.For the added permissions, check that the Status column lists the permission as
Granted
and has a green check icon.Request the API permissions (Application) for Microsoft Graph
Verify the API permissions Grant administrator consent. For information about how to grant consent, see Grant tenant-wide administrator consent to an application in the Microsoft Entra documentation.
Set up OAuth 2.0 for refresh token and password grant
You can use the OAuth 2.0 method to set up an Entra application registration and enable secure access to SharePoint. This method includes steps to configure the app registration, grant permissions, and establish authentication.
Google recommends that you set up federated credentials instead of configuring OAuth 2.0 authentication.
You can use the following process to register the application in Entra using OAuth 2.0 authentication for refresh token and for password grant. This method is preferred when you need granular control over SharePoint REST API permissions, allowing you to restrict resource access on the user account.
Some common error messages that you might encounter during this process are listed in Error messages.
The following table describes the SharePoint roles that are recommended for OAuth 2.0 authentication methods:
Create app registration:
Navigate to Entra administrator center.
Create an app registration:
- Supported account types: Accounts in the organizational directory only.
- Redirect URI:
https://vertexaisearch.cloud.google.com/console/oauth/sharepoint_oauth.html
.
Note the Client ID and Tenant ID.
Add client secret:
- Go to Certificates & secrets > New client secret.
- Note the secret string.
Set API permissions.
Add and grant the following Microsoft Graph permissions. You can choose between
Sites.FullControl.All
andSites.Selected
:Microsoft Graph permissions for OAuth 2.0 authentication
Permission Type Description Justification GroupMember.Read.All
Application Read all group memberships This permission allows Agentspace to understand the memberships of the user groups in the SharePoint site. User.Read
Delegated Sign in and read user's profile This is a default permission that must not be removed. When removed, SharePoint displays an error asking you to reinstate this permission.
Option 1: Sites.FullControl.All
Application Full control over all sites This permission allows Agentspace to obtain the SharePoint user groups and role assignments, which aren't included in the
Sites.Read.All
permission. It also allows Agentspace to index documents, events, comments, attachments, and files across all SharePoint sites.Option 2: Sites.Selected
Application Control over selected sites This permission allows Agentspace to obtain the SharePoint user groups and role assignments, which aren't included in the
Sites.Read.All
permission. It also allows Agentspace to index documents, events, comments, attachments, and files across selected SharePoint sites. This permission provides more granular control instead ofSites.FullControl.All
User.Read.All
Application Read all users' full profiles This permission allows Agentspace to understand the data access control for your SharePoint content. Add and grant the following SharePoint permissions for OAuth 2.0 authentication. You can choose between
AllSites.FullControl
andSites.Selected
:Sharepoint permissions for OAuth 2.0 authentication
Permission Type Description Justification Option 1: AllSites.FullControl
Delegated Full control over all sites This permission allows Agentspace to obtain the SharePoint user groups and role assignments, which aren't included in the
Sites.Read.All
permission. It also allows Agentspace to index documents, events, comments, attachments, and files across all SharePoint sites.Option 2: Sites.Selected
Delegated Control over selected sites This permission allows Agentspace to obtain the SharePoint user groups and role assignments, which aren't included in the
Sites.Read.All
permission. It also allows Agentspace to index documents, events, comments, attachments, and files across selected SharePoint sites. This permission provides more granular control instead ofAllSites.FullControl
For the added permissions, check that the Status column lists the permission as
Granted
and has a green check icon.Use a dedicated user account with limited access to specific sites. Verify that this account has Owner access to the selected sites.
Grant administrator consent. For information about how to grant consent, see Grant tenant-wide administrator consent to an application in the Microsoft Entra documentation.
Grant fullcontrol
permission selected sites
If you choose the Sites.Selected
option to grant control over selected sites
in Microsoft Graph, you must grant the fullcontrol
permission to
the Agentspace application. You can do so using one of
the following methods:
PowerShell
For a generic syntax to grant permissions using PnP PowerShell, see Granting permissions via PnP PowerShell.
Run the following command that provides the
FullControl
permission:Grant-PnPAzureADAppSitePermission -AppId CLIENT_ID -DisplayName DISPLAY_NAME -Permissions FullControl -Site SITE_URL
Replace the following:
CLIENT_ID
: the client ID of the Microsoft Entra application.SITE_URL
: the site URL for your SharePoint site, for example,https://example.sharepoint.com/sites/ExampleSite1
.DISPLAY_NAME
: a description for the Microsoft Entra application.
Microsoft Graph
For the overall process to grant permissions using Microsoft Graph, see Granting permissions via Microsoft Graph.
Use Microsoft Graph Explorer to call the following methods. These methods can be called only by a site owner.
Get the site ID:
GET `https://graph.microsoft.com/v1.0/sites/HOSTNAME:SITE_PATH`
Replace the following:
HOSTNAME
: the Sharepoint site's hostname—for example,example.sharepoint.com
.SITE_PATH
: the SharePoint site's path—for example,/sites/ExampleSite1
or/teams/ExampleSite2
.
Give
fullcontrol
access to the site whose ID you retrieved in the previous step.Send the following POST request:
POST `https://graph.microsoft.com/v1.0/sites/SITE_ID/permissions`
Use the following request body:
{ "roles": ["fullcontrol"], "grantedToIdentities": [{ "application": { "id": "CLIENT_ID", "displayName": "DISPLAY_NAME" } }] }
Replace the following:
SITE_ID
: the site ID for your SharePoint site that you received in the previous step. It has the formatexample.sharepoint.com,48332b69-85ab-0000-00o0-dbb7132863e7,2d165439-0000-0000-b0fe-030b976868a0
.CLIENT_ID
: the client ID of the Microsoft Entra application.DISPLAY_NAME
: a description for the Microsoft Entra application.
Error messages
The following table describes the common error messages and their descriptions that you might encounter when connecting SharePoint with Agentspace.
Error code | Error message |
---|---|
SHAREPOINT_MISSING_PERMISSION_1 |
Missing required REST API role (Sites.FullControl.All or Sites.Selected). For delegated permissions, missing AllSites.FullControl or Sites.Selected. |
SHAREPOINT_MISSING_PERMISSION_2 |
Missing required Graph API role (Sites.FullControl.All or Sites.Selected). |
SHAREPOINT_MISSING_PERMISSION_3 |
Missing required Graph API role GroupMember.Read.All. |
SHAREPOINT_MISSING_PERMISSION_4 |
Missing required Graph API role (User.Read.All or User.ReadBasic.All). |
SHAREPOINT_INVALID_SITE_URI |
Failed to retrieve Graph API access token. Possible causes: invalid client ID, secret value, or missing federated credentials. |
SHAREPOINT_INVALID_AUTH |
Failed to retrieve Graph API access token. Possible causes: invalid client ID, secret value, or missing federated credentials. |
SHAREPOINT_INVALID_JSON |
Failed to parse JSON content. |
SHAREPOINT_TOO_MANY_REQUESTS |
Too many HTTP requests sent to SharePoint; received 429 HTTP response. |
Create a SharePoint Online connector
After you have registered your application in Entra, you can create the the SharePoint connector in Google Cloud console.
Test the search engine
After configuring your search engine, test its capabilities. Make sure that it returns accurate results based on user access.
Enable web app:
- Go to the app integration configurations and toggle to Enable the web app.
Test web app:
Click Open next to the web app link and sign in with a user in your workforce pool.
Verify that search results are restricted to items accessible by the logged-in user.
Configure the workforce pool
The workforce pool lets you to manage and authenticate users from external identity providers, such as Azure or Okta, within Google Cloud console. To configure your workforce pool and enable the web app for seamless user access, do the following:
Create workforce pool at the organization level in Google Cloud by following the appropriate setup manual:
Configure the workforce pool in Agentspace > Settings for the region where you create your app.
Next steps
To attach your data store to an app, create an app and select your data store following the steps in Create an app.
To preview how your search results appear after your app and data store are set up, see Preview search results.
Use federated search with SharePoint
Before you begin
Before you can create the connector in Agentspace, you must set up an Entra application registration to enable secure access to SharePoint.
Register Agentspace as an OAuth 2.0 application in Entra.
- Navigate to Microsoft Entra admin center.
- In the menu, expand the Applications section and select App registrations.
- On the App registrations page, select New registration.
- Create an app registration on the Register an application page:
- In the Supported account types section, select Accounts in the organizational directory only.
In the Redirect URI section, select Web and enter the following URLs as web callback URLs (or redirect URLs):
https://vertexaisearch.cloud.google.com/console/oauth/sharepoint_oauth.html
https://vertexaisearch.cloud.google.com/oauth-redirect
Add a client secret:
- Go to Certificates & secrets and click New client secret.
- Copy and note the secret string.
Collect the following credentials:
- Client ID
- Client secret
- Instance URL
- Tenant ID
Configure these SharePoint API (Application) permissions with administrator consent:
Permission Type AllSites.Read Delegated MyFiles.Read Delegated Sites.Search.All Delegated Use a dedicated user account with limited access to specific sites.
Make sure the account has Owner access to the selected sites.
Create a federated search connector with SharePoint
User authorization
After creating a federated search data store, you can see it listed as one of the data sources in your source management panel. If you haven't previously authorized Agentspace, then you can't select the data source. Instead, an Authorize button appears next to it.
To initiate the authorization flow:
- Click Authorize. You are redirected to the SharePoint authorization server.
Sign in to your account.
Click Grant access. After granting access, you are redirected back to Agentspace to complete the authorization flow. Agentspace obtains the
access_token
, and uses it to access the 3P search.
Query execution
When you enter a search query:
- If SharePoint is authorized, Agentspace sends the query to the SharePoint API.
- Agentspace blends the results with those from other sources and displays them.
Data handling
When using third-party federated search, your query string is sent to the third-party search backend. These third parties may associate queries with your identity. If multiple federated search data sources are enabled, the query may be sent to all of them.
Once the data reaches the third-party system, it is governed by that system's Terms of Service and privacy policies (not by Google Cloud's terms).