Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
SharePoint CSOM
Developer environment
Windows
What browser(s) / client(s) have you tested
Additional environment details
- SharePoint tenant containing over hundread of SharePoint sites
- .NET CSOM / pnp library used
Describe the bug / error
I am trying to configure SharePoint site using provisioning template and application token authentication. This template was working for almost a year and suddenly started to throw timeout error during configuration of search. I tried to import search configuration as a separate step using CSOM but I am getting the same timeout error. Setting of clientContext.RequestTimeout config setting to "infinite" number does not help.
The only way how I managed to make things work was through SearchConfigurationPortability object, I noticed that internally context.Load is timing out and we can not control timeout time there so I just threw that part away and everything worked.
The only problem is that import of search configuration takes much more time than previously.
SearchConfigurationPortability searchConfig = new SearchConfigurationPortability(context);
SearchObjectOwner owner = new SearchObjectOwner(context, searchObjectLevel);
searchConfig.ImportSearchConfiguration(owner, searchConfiguration);
context.Load(searchConfig); // This line loads warnings and is causing constant timeout
context.ExecuteQueryRetry();
I also noticed that page containing crawled and managed properties takes years to open , check:
<sharepoint_site_url>/_layouts/15/listmanagedproperties.aspx?level=site
<sharepoint_site_url>/_layouts/15/listcrawledproperties.aspx?level=sitecol
Steps to reproduce
- Configure 4-5 search result sources targeting SharePoint content type (let's say page).
- Configure couple of custom search mapped/managed properties.
- Export search configuration through CSOM.
- Try to import search configuration using CSOM :
var clientContext = new ClientContext(url);
clientContext.ExecutingWebRequest += (object sender, WebRequestEventArgs e) =>
{
e.WebRequestExecutor.RequestHeaders.Add("Authorization", $"Bearer {token}");
};
clientContext.ImportSearchSettings(<path to exported search settings file>, SearchObjectLevel.SPSite);
clientContext.ExecuteQuery();
Expected behavior
The search configuration is successfully imported or meaningul error is thrown.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
SharePoint CSOM
Developer environment
Windows
What browser(s) / client(s) have you tested
Additional environment details
Describe the bug / error
I am trying to configure SharePoint site using provisioning template and application token authentication. This template was working for almost a year and suddenly started to throw timeout error during configuration of search. I tried to import search configuration as a separate step using CSOM but I am getting the same timeout error. Setting of clientContext.RequestTimeout config setting to "infinite" number does not help.
The only way how I managed to make things work was through SearchConfigurationPortability object, I noticed that internally context.Load is timing out and we can not control timeout time there so I just threw that part away and everything worked.
The only problem is that import of search configuration takes much more time than previously.
I also noticed that page containing crawled and managed properties takes years to open , check:
<sharepoint_site_url>/_layouts/15/listmanagedproperties.aspx?level=site
<sharepoint_site_url>/_layouts/15/listcrawledproperties.aspx?level=sitecol
Steps to reproduce
Expected behavior
The search configuration is successfully imported or meaningul error is thrown.