With the Microsoft® OneDrive® connector, you can use commands in a chain to manage files and folders in Microsoft OneDrive or SharePoint®. For example, with this connector, you can:
- Copy, delete, and search for files and folders
- Download and upload files
- List available drives
Note: This connector is built by Workiva and connects to a third-party system. While our Support team can help configure this connector within your workspace, we are unable to troubleshoot or otherwise assist with any issues that originate outside of the Workiva platform.
Prerequisites
To enable the connection, the connector uses the Microsoft Graph API. To secure the connection, the connector uses OAuth authentication via a designated application registered with the Microsoft application registration portal or Azure® Active Directory®.
To set up the connector, you'll need:
- An application registered with the Microsoft application registration portal or Azure Active Directory. Record your application ID
- The Azure application's OAuth client ID and secret
- The Azure application's scopes, appropriate for the commands the connector will perform
- The type and ID of the drive to connect to.
Note: You can use Microsoft's Graph Explorer (external link) to retrieve these from Sharepoint.
- The project's redirect URI:
Example setup of Microsoft Azure for OneDrive
Registering an Application
- Log in to your Microsoft Azure Portal:
https://azure.microsoft.com/en-us/account/
- Navigate into your Azure Active Directory services
- Navigate to App Registrations under Manage and click on New Registration
- Provide a desired Application Name and then press Register
Configure Application Authentication
- Log in to your Microsoft Azure Portal:
https://azure.microsoft.com/en-us/account/
- Navigate into your Azure Active Directory services
- Navigate to App Registrations under Manage
- Navigate to Authentication under the updated Manage panel
- Under "Supported account types," choose Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant).
- Under the Add a Platform select Web
- Under the Redirect URI enter the valid callback URL from above
- Make sure to check the box for MultiTenant under Supported Account Types
Note: As the OneDrive Connector requires the MultiTenant option to be enabled it is up to the Azure Administrators to ensure applications are correctly configured for security compliance. This option, when correctly used with Azure security, does not open up the application to everyone. Below are suggestions on additional steps that can be taken.
- Review the documentation from Microsoft related to MultiTenant setup.
https://docs.microsoft.com/en-us/azure/active-directory/develop/single-and-multi-tenant-apps#best-practices-for-multi-tenant-apps - Enable security on the individual application.
https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-restrict-your-app-to-a-set-of-users#update-the-app-to-require-user-assignment - Assign/allow users access to the application.
https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-restrict-your-app-to-a-set-of-users#assign-the-app-to-users-and-groups
Setting up Certificates and Secrets
- Log in to your Microsoft Azure Portal:
https://azure.microsoft.com/en-us/account/
- Navigate into your Azure Active Directory services
- Navigate to App Registrations under Manage
- Navigate to Certificates under the updated Manage panel
- Click New Client Secret in the center panel
- After providing a brief Description and Expiry date a Client Secret will be displayed. This will need to be stored for safe keeping and entry into the Microsoft OneDrive connector.
Setting up API Permissions
- Log in to your Microsoft Azure Portal:
https://azure.microsoft.com/en-us/account/
- Navigate into your Azure Active Directory services
- Navigate to App Registrations under Manage
- Navigate to API Permissions under the updated Manage panel
- Click on Add a Permission in the center panel
- Choose Microsoft Graph under Microsoft APIs
- Choose Delegate Permissions as the Request Type
- From the list of permissions you will need:
User.Read, Everything under FILES and OpenId.offline_access
- Click Grant Admin Consent.
Define the level access required by the connector. The following scopes are supported by the Microsoft OneDrive connector:
Files.ReadWrite.Selected Files.ReadWrite.AppFolder Files.ReadWrite.All Files.ReadWrite Files.Read.Selected Files.Read.All Files.Read offline_access
The offline_access
scope is required at minimum.
Enabling Security
- Login to your Microsoft Azure Portal:
https://azure.microsoft.com/en-us/account/
- Navigate into your Azure Active Directory services
- Click on Enterprise Applications under Manage
- Select your application from the list to start the edit process. If your application is not listed by default, click on All Applications under manage
- Click on Properties under Manage
-
On the properties screen set the following properties to allow use of the API access created above:
-
Enabled for users to sign-in? = Yes
-
User assignment required? = Yes
-
(Optional) Visible to users? = No
-
- Next click on Users and Groups under manage
- Through standard Azure AD processes, add your users as necessary. This is the list of users that are allowed to use OneDrive and have a proper Microsoft OneDrive license.
Set up the Microsoft OneDrive connector
Note: To make the connector available for use in your organization's chains, an org security administrator first enables it from Configuration.
- From Chain Builder, click Connections , and then Create at the top right.
- Under Connector Connection, select Microsoft OneDrive and the default CloudRunner.
- Under Basic Info, enter a unique name and description to help identify the connector.
- Under OAuth, enter the OAuth client ID and secret for the connector's Azure application.
- To determine the connector's level of access, enter the Azure application's authentication scope.
- At minimum, the
offline_access
scope is required.
- At minimum, the
- To authorize the connection and OAuth credentials, click Connect.
- Under Properties, enter the connection's details:
Property Details Drive type Select the type of drive to connect to, such as Drive, Group, User, or Site. To connect to your own user drive, select Current User (Me). Drive type ID Enter the ID of the drive to connect to, based on Drive type. For example, if Drive type is User, enter the user ID; if Site, the site ID. Note: You can use Microsoft's Graph Explorer (external link) to retrieve these from Sharepoint.
- Select the environments to use with the connection, and click Save.
- To test the connection, create and run a chain with the connector's Download File command, and verify it returns a valid output.
Troubleshooting
If the connection to Microsoft OneDrive or SharePoint fails:
- Verify the OAuth credentials of the connector's Azure application.
- Check the drive type and ID entered for the connector. You can use Microsoft's Graph Explorer (external link) to retrieve these from Sharepoint.
- Verify the project's redirect URI: