

# Microsoft OneDrive action integration
<a name="onedrive-action-integration"></a>

Use the Microsoft OneDrive action connector to manage OneDrive files, folders, and Excel workbooks directly in Amazon Quick through natural language.

Setting up this integration involves two steps. First, you register an application in Microsoft Entra and configure its permissions. Then, you create the integration in Amazon Quick and connect it to your Entra app. For information about the authentication methods that Amazon Quick supports, see [Authentication methods](quick-action-auth.md).

## Before you begin
<a name="onedrive-action-prerequisites"></a>

Make sure you have the following before you set up the integration.
+ A Microsoft 365 account with OneDrive access.
+ Access to the [Microsoft Entra admin center](https://entra.microsoft.com/) with at least Application Developer permissions.
+ For subscription requirements, see [Set up integrations in the console](integration-console-setup-process.md).

## Configure Microsoft Entra
<a name="onedrive-entra-setup"></a>

Before you configure Amazon Quick, create an app registration in Microsoft Entra. Complete all of the following steps in Entra before moving to the Amazon Quick console.

For more information about app registrations, see [Register an application with the Microsoft identity platform](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app) in the Microsoft documentation.

### Register the application
<a name="entra-app-registration"></a>

1. Open the [Microsoft Entra admin center](https://entra.microsoft.com/).

1. In the left navigation, choose **Entra ID**, then choose **App registrations**.

1. Choose **New registration**.

1. For **Name**, enter a descriptive name for your integration.

1. For **Supported account types**, choose **Accounts in this organizational directory only**.

1. For **Redirect URI**, select **Web** and enter `https://{region}.quicksight.aws.amazon.com/sn/oauthcallback`. Replace *\$1region\$1* with the AWS Region where your Amazon Quick instance is deployed.

1. Choose **Register**.

1. On the overview page, copy the **Application (client) ID** and **Directory (tenant) ID**. You need these values for the Amazon Quick configuration.

### Create a client secret
<a name="entra-client-secret"></a>

Amazon Quick needs a client secret to authenticate with Microsoft Entra. This secret acts as a password for the app registration.

1. From your app registration, choose **Certificates & secrets**.

1. Choose **New client secret**.

1. Enter a description and choose an expiration period.

1. Choose **Add**.

1. Copy the **Value** immediately. This value is only displayed once.

**Important**  
Copy the secret **Value**, not the Secret ID. The Value is the longer string used for authentication.

### Configure API permissions
<a name="onedrive-entra-api-permissions"></a>

This integration uses delegated permissions, which allow the app to act on behalf of a signed-in user. For more information, see [Overview of Microsoft Graph permissions](https://learn.microsoft.com/en-us/graph/permissions-overview) in the Microsoft documentation.

1. From your app registration, choose **API permissions**.

1. Choose **Add a permission**, then choose **Microsoft Graph**.

1. Choose **Delegated permissions** and add the permissions from the table below.

1. Choose **Grant admin consent for [your tenant name]** to approve the permissions.

Add the following as Delegated permissions in your Entra app registration. For the full permissions reference, see [Microsoft Graph permissions reference](https://learn.microsoft.com/en-us/graph/permissions-reference) in the Microsoft documentation.


**OneDrive action integration – delegated permissions**  

| Permission | Description | 
| --- | --- | 
| Files.ReadWrite | Allows the app to read, create, update, and delete the signed-in user's files. | 
| User.Read.All | Allows the app to read the full set of profile properties of all users in the organization on behalf of the signed-in user. | 
| offline\$1access | Allows the app to refresh access tokens without requiring the user to sign in again. This reduces how often users need to re-authenticate. | 

### Record your credentials
<a name="entra-record-credentials"></a>

Before leaving the Microsoft Entra admin center, confirm you have the following values. You need them for the Amazon Quick configuration.


**Required credentials from Microsoft Entra**  

| Value | Where to find it | 
| --- | --- | 
| Application (client) ID | App registration overview page | 
| Directory (tenant) ID | App registration overview page | 
| Client secret value | Certificates & secrets page | 

## Set up the integration in Amazon Quick
<a name="onedrive-action-integration-setup"></a>

After you complete the Entra configuration, create the integration in Amazon Quick.

1. In the Amazon Quick console, choose **Integrations**.

1. Choose **Microsoft OneDrive** and choose the Add (plus "\$1") button.

1. Choose the **Actions** tab.

1. Choose **Perform actions in Microsoft OneDrive**.

1. Fill in the integration details:
   + **Name** – Descriptive name for your OneDrive integration.
   + **Description** (Optional) – Purpose of the integration.

1. Fill in the connection settings:
   + **Base URL** – `https://graph.microsoft.com/v1.0`
   + **Client ID** – Application (client) ID from your Entra app registration.
   + **Client Secret** – Client secret value from your Entra app registration.
   + **Token URL** – `https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token`
   + **Auth URL** – `https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/authorize`
   + **Redirect URL** – `https://{region}.quicksight.aws.amazon.com/sn/oauthcallback`

1. Choose **Create and continue**.

1. Choose users to share the integration with.

1. Choose **Next**.

## Available actions
<a name="onedrive-integration-actions"></a>

After you set up the integration, the following actions are available.


**Microsoft OneDrive available actions**  

| Category | Action | Description | 
| --- | --- | --- | 
| Drive and items | Get Drive | Retrieve the properties and relationships of a drive. | 
| Drive and items | List Item | Get all items contained in the drive. | 
| Drive and items | Get Item | Get an item contained in the drive. | 
| Drive and items | Create Folder | Create a new folder in the user's drive. | 
| Drive and items | Update Item | Update the metadata for a file or folder. | 
| Drive and items | Delete Item | Delete a file or folder. Moves the item to the recycle bin. | 
| Drive and items | List Child Folders | Return a collection of items in the children of a folder. | 
| Drive and items | Copy Item | Create a copy of a file or folder to another location. | 
| Drive and items | Add Permissions | Send a sharing invitation for a file or folder. | 
| Drive and items | Upload File | Upload a new file or update an existing file. Supports files up to 250 MB. | 
| Excel workbooks | List Sheets | Retrieve a list of worksheet objects. | 
| Excel workbooks | Add Sheet | Add a new worksheet to the workbook. | 
| Excel workbooks | Read Sheet | Retrieve the properties of a worksheet object. | 
| Excel workbooks | Update Sheet | Update the properties of a worksheet object. | 
| Excel workbooks | Delete Sheet | Delete the worksheet from the workbook. | 
| Excel workbooks | Read Cell | Get the value of a single cell by row and column number. | 
| Excel workbooks | Write Cell | Set the value of a single cell by row and column number. | 
| Excel workbooks | Read Range | Get the values of a range. | 
| Excel workbooks | Write Range | Update the values of a range. | 
| Excel workbooks | Clear Range | Clear range values, format, fill, and border. | 
| Excel workbooks | Delete Range | Delete the cells associated with the range. | 
| Excel workbooks | Get Used Range | Get the smallest range that encompasses cells with a value or formatting. | 

## Manage and troubleshoot
<a name="entra-troubleshooting"></a>

To edit, share, or delete your integration, see [Managing existing integrations](integration-workflows.md#managing-existing-integrations).

### Authentication issues
<a name="entra-troubleshooting-auth"></a>
+ **Incorrect app registration** – Verify the app registration in Microsoft Entra includes the required API permissions and that admin consent has been granted.
+ **Expired client secret** – Check if the client secret has expired in **Certificates & secrets** and generate a new one if needed.
+ **Incorrect redirect URI** – Verify the redirect URI in Microsoft Entra matches `https://{region}.quicksight.aws.amazon.com/sn/oauthcallback`.

### Common error messages
<a name="entra-troubleshooting-errors"></a>
+ **`Access denied. You do not have permission to perform this action`** – The authenticated user does not have the required permissions. Contact your administrator to verify and grant appropriate permissions.
+ **`AADSTS50020: User account from identity provider does not exist in tenant`** – The user account is not configured in the correct Microsoft Entra tenant. Verify the user account exists in the tenant that matches the Directory (tenant) ID in your app registration.