---
title: Connecting to SharePoint Online
related:
  - https://docs.kentico.com/k82/integrating-3rd-party-systems/integrating-sharepoint/configuring-sharepoint-integration-connections.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

> **Info:** The **identity client runtime** contained in the SharePoint Server 2013 client components is **necessary for successful SharePoint authorization**.
>
> If you don't have the runtime installed on your server machine, you can experience an issue with the _msoidcliL.dll_ dynamic link library.

Learn what you need to do if you cannot connect to SharePoint Online due to the missing runtime when:

- running Kentico in a standard environment
- running Kentico in a Microsoft Azure environment

## Connecting to SharePoint Online in a standard environment

If you cannot connect to SharePoint Online when running Kentico in a standard environment, download and install _SharePoint Server 2013 Client Components SDK_, available on the Microsoft website.

> **Note:** After installing the SharePoint Server 2013 client components, restart your application (by clicking **Restart application** in **System -> General**).

## Connecting to SharePoint Online in a Microsoft Azure environment

If you cannot connect to SharePoint Online when [running Kentico in aMicrosoft Azureenvironment](https://docs.kentico.com/k82/running-kentico-on-microsoft-azure.md):

1. Download the appropriate version of _SharePoint Server 2013 Client Components SDK_ from the Microsoft website.
   - For example, if you are running Kentico on a 64 bit machine, download the _sharepointclientcomponents\_x64.msi_ installation file.
2. Open your Azure project in Visual Studio.
3. Create the **startup.cmd** batch file containing the following block of code:

   ```csharp

   msiexec /i sharepointclientcomponents_VERSION.msi /q /log sharepointclientcomponentinstall.log

   ```

   - Replace \_VERSION with the identification of the edition of your downloaded SharePoint Server 2013 client components, i.e. \_x32 or \_x64.
   - The code ensures that the system installs the client components.
4. Add the following files to your Azure project's **CMS** directory.

   - **startup.cmd**
   - **sharepointclientcomponents\_VERSION.msi**
5. Include these files into the project and set them to be copied to the output directory:
   1. Click **Show All Files** in the Solution Explorer toolbar.
   2. Right-click the file and select **Include In Project**.
   3. Right-click the file again and select **Properties**.
   4. In Properties, set **Copy to Output Directory** to **Copy always**.
   5. Repeat also for the other file.
6. Open the CMSAzure\\**ServiceDefinition.csdef** file.
7. Add the following block of code to the file's WebRole tag:

   ```csharp

   <Startup>
      <Task commandLine="startup.cmd" executionContext="elevated" taskType="background" />
   </Startup>

   ```

   - The code ensures that the system executes the startup.cmd batch file on startup of the virtual machine on Azure.
8. Save and close the file.

We apologize that we currently cannot provide a more straightforward solution. This is due to restrictions imposed on the distribution of the third-party software components.
