---
description: Connecting your tenant with SharePoint and OneDrive
---

# Microsoft Azure

## Configuring SharePoint & OneDrive Access

Connecting your SharePoint/OneDrive workspace to Study Tracker is a two-step process:

1. Create an Azure Active Directory App.
2. Register the app with Study Tracker.

### Creating an Azure Active Directory (AD) App

* Log into the [Azure portal](https://portal.azure.com/). Go to the Azure AD page.
* On the Azure AD page, make a note of the **Primary Domain** value. Click the 'App Registrations' tab and then click the 'New Registration' button.
* Give your application a distinct name (eg. Study Tracker). Under 'Supported Account Types', make sure the default value is selected ("Accounts in this organizational directory only"). Do not add a Redirect URI. Click 'submit'.

<figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2FHPRBAZegWAV4kje9iFlP%2Fimage.png?alt=media&#x26;token=84f7cf55-7dac-4f53-aefe-8c82889a90f3" alt="" width="563"><figcaption><p>The new application form</p></figcaption></figure>

* When you are redirected to the details page for your new application, make a note of the **Client ID** and **Tenant ID** values.

<figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2FwJroP7VNONmzpB0JQKx4%2Fimage.png?alt=media&#x26;token=9f276728-e9b1-48dd-8a35-609f28294e11" alt="" width="563"><figcaption></figcaption></figure>

* We also need to generate a Client Secret ID for authentication. Click 'Add a certificate or secret'.
* On the next page, click 'New client secret'. In the window that opens, provide a name for your secret key and set the expiration date. Click 'Add'.

<figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2FR4VVg0kFrkB2gvZreDvb%2Fimage.png?alt=media&#x26;token=50d7285d-ce1a-43c5-ac48-6c661d56b0df" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
If you set an expiration date for your key, be sure to refresh your secret and update Study Tracker before the expiration date!
{% endhint %}

* When your secret key is created, make a note of the **Value** and **Secret ID** values.
* Next, we need to grant your application permission to access resources in your Microsoft account. Click on the 'API Permissions' tab of the application details page.
* Click 'Add a permission'. When asked to choose an API, select 'Microsoft Graph'. When asked to choose permission type, select 'Application Permissions'.
* Search-for and add the following permissions:
  * `Files.ReadWrite.All`
  * `Sites.Read.All`
  * `User.Read.All`

<figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2FbqtjWGWdKR2LJqs2oIsJ%2Fimage.png?alt=media&#x26;token=99998ece-d18d-48bb-9452-a6eaa7609fee" alt="" width="563"><figcaption><p>The required API permissions</p></figcaption></figure>

{% hint style="info" %}
If you'd prefer not to grant Study Tracker access to all of your organization's SharePoint sites, you can use the `Sites.Selected` permission in place of `Sites.Read.All`. You can refer to this article for instructions on granting your Azure AD app access to sites: [https://blog.dan-toft.dk/2022/12/sites-selected-permissions/](https://blog.dan-toft.dk/2022/12/sites-selected-permissions/)
{% endhint %}

* You will notice that some of the selected permissions require consent to be granted on behalf of the organization. Unless you are logged-in as an admin user, you will have to to get an admin to sign in and perform this task for you.

### Registering your Azure AD App in Study Tracker

* Log into Study Tracker as an admin user and go to the Admin Dashboard. Click the 'Microsoft Azure' tab. Click 'Register Microsoft Azure Integration'.

<figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2Flmws7gkAUaExpSWQ7lpi%2Fimage.png?alt=media&#x26;token=05603512-0ab3-4628-bfde-bd0e47d89b2f" alt="" width="563"><figcaption><p>The Azure admin tab, before registering your app</p></figcaption></figure>

* In the popup window, provide the following information:
  * **Name**: a display name for your Azure integration or account.
  * **Domain**: the primary domain of your Microsoft account, as found in your Azure AD dashboard. This typically takes the format of `myorganization.onmicrosoft.com`.
  * **Tenant ID:** the tenant/directory ID of your Azure AD app.
  * **Client ID**: the client/application ID of your Azure AD app.
  * **Client Secret**: the secret value generated for your Azure AD app (not the Secret ID).

<figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2FfvASBDem2dV0ZaGAlth2%2Fimage.png?alt=media&#x26;token=95e78b0f-9814-4717-bb35-780ee8b94612" alt="" width="563"><figcaption><p>The Azure integration form</p></figcaption></figure>

* Click 'Submit'. If the information you have provided is correct, the integration will complete successfully and the Azure Integration page will reload.

<figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2FDB8Y3f55v9esLVyomNGf%2Fimage.png?alt=media&#x26;token=e1aa3ec3-4498-410b-b207-d7713fed83f1" alt="" width="563"><figcaption><p>A successful Azure integration</p></figcaption></figure>

## Adding SharePoint Sites and OneDrive Drives

Once you have successfully configured access to your Microsoft environment, you can connect SharePoint sites and OneDrive Drives to Study Tracker. Currently, this serves only to allow Study Tracker to browse and write study files to the Drives that support SharePoint sites. Study Tracker does not have the ability to read or publish any other SharePoint data, and does not have the ability to connect to private OneDrive Drives.

* Click the 'Add SharePoint Site' button.
* On the popup window, search-for and select the SharePoint Site you want to connect to. Click 'Submit'.

<figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2FubaslKuhv3MbUhtXomwH%2Fimage.png?alt=media&#x26;token=0b522cef-e277-49c1-a372-a09facf20712" alt="" width="563"><figcaption><p>SharePoint site selection dialog</p></figcaption></figure>

* Once complete, the selected SharePoint Site and any attached Drives will be displayed in the Microsoft Azure page in the Admin Dashboard.

<figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2F22MlhPTWkodNGHFMLhNn%2Fimage.png?alt=media&#x26;token=ced26ef9-59c5-4916-a04c-718dbed1feb6" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
Before you can browse or write study files to any available Drives, you have to [add a Root Storage Folder](../../managing-your-tenant/storage-folders#adding-root-folders).
{% endhint %}
