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.
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:
- Go to the Azure portal (https://portal.azure.com) and sign in with your Azure account.
- Navigate to the "Azure Active Directory" service.
- Select "App registrations" from the left-hand menu.
- Click on the "New registration" button to register a new application.
- Provide a name for your app, and optionally select the supported account types (e.g., single tenant, multi-tenant).
- Click on the "Register" button to create the app registration.
- 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.
- Scroll down to the "API permissions" section and click on the "Add a permission" button.
- In the "Request API permissions" pane, select "Microsoft Graph" as the API.
Choose the application permissions and select the following permissions under the "Application" tab:
- 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.
Click on "Certificates & Secrets" tab. Go to Client Secrets. Generate a new client secret and keep a note of the string present under
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 --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:
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>
elasticsearch.api_key is the recommended authentication method. However, you can also use
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:220.127.116.11 \ /app/bin/elastic-ingest \ -c /config/config.yml
DOCKER.md in the
elastic/connectors repo for more details.
Find all available Docker images in the official registry.
The following configuration fields are required:
Azure application Client ID
Unique identifier for your Azure Application, found on the app’s overview page. Example:
Azure application Client Secret
String value that the application uses to prove its identity when requesting a token, available under the
Certificates & Secretstab of your Azure application menu. Example:
Azure application Tenant ID
Unique identifier of your Azure Active Directory instance. Example:
Maximum retries per request
The number of retry attempts after failed request to OneDrive. Default value is
Refer to Content extraction for more details.
Documents and syncsedit
The connector syncs the following objects and entities:
- Includes metadata such as file name, path, size, content, etc.
- 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.
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.
See Content extraction.
Connector client operationsedit
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
make ftest NAME=onedrive DATA_SIZE=small
There are currently no known issues for this connector. Refer to Known issues for a list of known issues for all connectors.
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).