> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withampersand.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft

The Microsoft connector supports all products which are a part of the Microsoft Graph API. These include:

* OneDrive
* SharePoint
* Outlook
* OneNote
* Teams

For a full list of supported products, refer to [Microsoft documentation](https://learn.microsoft.com/en-us/graph/overview-major-services).

We also have connectors for:

* [Dynamics CRM](/provider-guides/dynamicsCRM)
* [Dynamics Business Central](/provider-guides/dynamicsBusinessCentral)

## What's Supported

### Supported Actions

This connector supports:

* [Read Actions](/read-actions), including full historic backfill and incremental read.
* [Write Actions](/write-actions).
* [Proxy Actions](/proxy-actions), using the base URL `https://graph.microsoft.com`.

### Supported Objects

The Microsoft Graph connector supports **many Microsoft Graph API objects** including but not limited to:

* [users](https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0)
* [calendars](https://learn.microsoft.com/en-us/graph/api/resources/calendar?view=graph-rest-1.0)
* [me/events](https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0)
* [me/messages](https://learn.microsoft.com/en-us/graph/api/resources/message?view=graph-rest-1.0)

For the complete list of supported Graph API resources, refer to the [Microsoft Graph API documentation](https://learn.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0).

To figure the exact OAuth scope you will require based on the objects you need to integrate with, you can use a tool such as [Graph Permissions Explorer](https://graphpermissions.merill.net/permission/).

### Example Integration

For an example manifest file of a Microsoft integration, visit our [samples repo on Github](https://github.com/amp-labs/samples/blob/main/microsoft/amp.yaml).

## Before You Get Started

To connect Microsoft services with Ampersand, you will need [a Microsoft Account](https://aka.ms/AppRegistrations/?referrer=https%3A%2F%2Fdev.onedrive.com).

Once your account is created, you'll need to create an app in the Azure portal, configure the Ampersand redirect URI within the app, and obtain the following credentials from your app:

* Client ID
* Client Secret
* Scopes

You will then use these credentials to connect your application to Ampersand.

### Create a Microsoft Account

Here's how you can sign up for a Microsoft account:

* Go to the [Microsoft Sign up page](https://signup.live.com/signup?sru=https%3a%2f%2flogin.live.com%2foauth20_authorize.srf%3flc%3d1033%26client_id%3d51483342-085c-4d86-bf88-cf50c7252078%26cobrandid%3ded5d1924-9524-4e70-8f68-5ee5e35afbef%26mkt%3dEN-US%26opid%3dE962B0DAAE1D7D3B%26opidt%3d1721584016%26uaid%3d20aa40834b4b4f60a5f6d0caefa69aab%26contextid%3d8123EC532BFC171F%26opignore%3d1\&mkt=EN-US\&uiflavor=web\&lw=1\&fl=easi2\&cobrandid=ed5d1924-9524-4e70-8f68-5ee5e35afbef\&client_id=51483342-085c-4d86-bf88-cf50c7252078\&uaid=20aa40834b4b4f60a5f6d0caefa69aab\&suc=c44b4083-3bb0-49c1-b47d-974e53cbdf3c\&lic=1).
* Sign up using your preferred method and verify your email.

### Creating a Microsoft App

Follow the steps below to create a Microsoft app and add the Ampersand redirect URL.

1. Log in to your [Azure Portal](https://portal.azure.com/).

2. Navigate to **Azure Active Directory** > **App registrations**.

3. Click the **New registration** button.

4. In the **Register an application** window, enter the **Name** and select the **Supported account types**.

5. In the **Redirect URI** section, select **Web** and enter the Ampersand redirect URL: `https://api.withampersand.com/callbacks/v1/oauth`.

6. Click **Register**.

7. In the left-hand sidebar, navigate to **Certificates & secrets**.

8. Click **New client secret** and provide a description and expiration period.

9. Click Add. Note the Client Secret value. You will need it later.

10. In the left-hand sidebar, navigate to **Manage >> API permissions**.

11. Click **Add a permission** and choose the required scopes. You must include the **offline\_access** scope.

12. Generate

    <img src="https://mintcdn.com/ampersand-24eb5c1a/CkzFg-K1u4gYx3ZD/images/provider-guides/e0b0327-Microsoft1.gif?s=ab255af17eb64c32c1eb9c5ab97562ff" alt="Microsoft App Creation" width="1440" height="670" data-path="images/provider-guides/e0b0327-Microsoft1.gif" />

## Add Your Microsoft App Info to Ampersand

1. Log in to your [Ampersand Dashboard](https://dashboard.withampersand.com).

2. Select the project where you want to create a Microsoft integration.

   <img src="https://mintcdn.com/ampersand-24eb5c1a/Bx3tggG51e0liOp-/images/provider-guides/31a6a12-Ampersand.png?fit=max&auto=format&n=Bx3tggG51e0liOp-&q=85&s=7ebd893fd2a976ebe7cf8af53f8581b8" alt="Ampersand Project Selection" width="2244" height="442" data-path="images/provider-guides/31a6a12-Ampersand.png" />

3. Select **Provider Apps**.

4. Select **Microsoft** from the **Provider** list.

5. Enter the previously generated Client Secret in the **Client Secret** field.

6. For the **Client ID** field, go to the Overview page in your Microsoft application, and copy the **Application ID**.

7. Enter the exact set of scopes that you had previously configured in your Microsoft app.

8. Click **Save Changes**.

## Using the connector

To start integrating with Microsoft:

* Create a manifest file like the [example](https://github.com/amp-labs/samples/blob/main/microsoft/amp.yaml).
* Deploy it using the [amp CLI](/cli/overview).
* If you are using Read Actions, create a [destination](/destinations).
* Embed the [InstallIntegration](/embeddable-ui-components#install-integration) UI component.
* Start using the connector!
  * If your integration has [Read Actions](/read-actions), you'll start getting webhook messages.
  * If your integration has [Write Actions](/write-actions), you can start making API calls to our Write API.
  * If your integration has [Proxy Actions](/proxy-actions), you can start making Proxy API calls.

<Warning>In order to receive a refresh token and be able to access your customers' Microsoft Graph APIs without reauthenticating, you must include the `offline_access` permission when registering the app with Ampersand</Warning>
