Elastic OneDrive connector referenceedit

The Elastic OneDrive connector is a connector for OneDrive.

Availability and prerequisitesedit

This connector is available as a native connector as of Elastic version 8.11.0.

This connector is available as a connector client from the Elastic connector framework.

This connector client is compatible with Elastic versions 8.10.0+.

To use this connector, satisfy all connector client requirements.

This connector is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

Usageedit

To use this connector as a connector client, use the OneDrive tile from the connectors list Customized connector workflow.

For additional operations, see Using connectors.

Connecting to OneDriveedit

To connect to OneDrive you need to create an Azure Active Directory application and service principal that can access resources.

Follow these steps:

  1. Go to the Azure portal (https://portal.azure.com) and sign in with your Azure account.
  2. Navigate to the "Azure Active Directory" service.
  3. Select "App registrations" from the left-hand menu.
  4. Click on the "New registration" button to register a new application.
  5. Provide a name for your app, and optionally select the supported account types (e.g., single tenant, multi-tenant).
  6. Click on the "Register" button to create the app registration.
  7. After the registration is complete, you will be redirected to the app’s overview page. Take note of the "Application (client) ID" value, as you’ll need it later.
  8. Scroll down to the "API permissions" section and click on the "Add a permission" button.
  9. In the "Request API permissions" pane, select "Microsoft Graph" as the API.
  10. Choose the application permissions and select the following permissions under the "Application" tab: User.Read.All, File.Read.All
  11. Click on the "Add permissions" button to add the selected permissions to your app. Finally, click on the "Grant admin consent" button to grant the required permissions to the app. This step requires administrative privileges. ℹ️ NOTE: If you are not an admin, you need to request the Admin to grant consent via their Azure Portal.
  12. Click on "Certificates & Secrets" tab. Go to Client Secrets. Generate a new client secret and keep a note of the string present under Value column.

Deployment using Dockeredit

Connector clients are run on your own infrastructure.

You can deploy the OneDrive connector as a self-managed connector client using Docker. Follow these instructions.

Step 1: Download sample configuration file

Download the sample configuration file. You can either download it manually or run the following command:

curl https://raw.githubusercontent.com/elastic/connectors/main/config.yml.example --output ~/connectors-config/config.yml

Remember to update the --output argument value if your directory name is different, or you want to use a different config file name.

Step 2: Update the configuration file for your self-managed connector

Update the configuration file with the following settings to match your environment:

  • elasticsearch.host
  • elasticsearch.api_key
  • connectors

If you’re running the connector service against a Dockerized version of Elasticsearch and Kibana, your config file will look like this:

# When connecting to your cloud deployment you should edit the host value
elasticsearch.host: http://host.docker.internal:9200
elasticsearch.api_key: <ELASTICSEARCH_API_KEY>

connectors:
  -
    connector_id: <CONNECTOR_ID_FROM_KIBANA>
    service_type: onedrive
    api_key: <CONNECTOR_API_KEY_FROM_KIBANA>

Using the elasticsearch.api_key is the recommended authentication method. However, you can also use elasticsearch.username and elasticsearch.password to authenticate with your Elasticsearch instance.

Note: You can change other default configurations by simply uncommenting specific settings in the configuration file and modifying their values.

Step 3: Run the Docker image

Run the Docker image with the Connector Service using the following command:

docker run \
-v ~/connectors-config:/config \
--network "elastic" \
--tty \
--rm \
docker.elastic.co/enterprise-search/elastic-connectors:8.10.4.0 \
/app/bin/elastic-ingest \
-c /config/config.yml

Refer to DOCKER.md in the elastic/connectors repo for more details.

Find all available Docker images in the official registry.

Configurationedit

The following configuration fields are required:

Azure application Client ID

Unique identifier for your Azure Application, found on the app’s overview page. Example:

  • ab123453-12a2-100a-1123-93fd09d67394
Azure application Client Secret

String value that the application uses to prove its identity when requesting a token, available under the Certificates & Secrets tab of your Azure application menu. Example:

  • eyav1~12aBadIg6SL-STDfg102eBfCGkbKBq_Ddyu
Azure application Tenant ID

Unique identifier of your Azure Active Directory instance. Example:

  • 123a1b23-12a3-45b6-7c8d-fc931cfb448d
Maximum retries per request
The number of retry attempts after failed request to OneDrive. Default value is 3.

Content Extractionedit

Refer to Content extraction for more details.

Documents and syncsedit

The connector syncs the following objects and entities:

  • Files

    • Includes metadata such as file name, path, size, content, etc.
  • Folders
  • Files bigger than 10 MB won’t be extracted.
  • Permissions are not synced. All documents indexed to an Elastic deployment will be visible to all users with access to that Elastic Deployment.

Sync rulesedit

Basic sync rules are identical for all connectors and are available by default. For more information read Types of sync rule.

Advanced sync rules are not available for this connector in the present version.

Content Extractionedit

See Content extraction.

Connector client operationsedit

End-to-end testingedit

The connector framework enables operators to run functional tests against a real data source. Refer to Connector testing for more details.

To perform E2E testing for the GitHub connector, run the following command:

$ make ftest NAME=onedrive

For faster tests, add the DATA_SIZE=small flag:

make ftest NAME=onedrive DATA_SIZE=small

Known issuesedit

There are currently no known issues for this connector. Refer to Known issues for a list of known issues for all connectors.

Troubleshootingedit

See Troubleshooting.

Securityedit

See Security.

Framework and sourceedit

This connector is included in the Elastic connector framework.

View the source code for this connector (branch 8.10, compatible with Elastic 8.10).