Configure data source
- Last UpdatedJun 27, 2025
- 4 minute read
To use the adapter, you must configure the data source from which it polls data, an event hub, and a storage account. For more information on event hubs and the storage account, see Principles of operation.
Configure the data source
Complete the following steps to configure an adapter data source. Use the PUT method in conjunction with the api/v1/configuration/<ComponentId>/DataSource REST endpoint to initialize the configuration.
-
Using a text editor, create an empty text file.
-
Copy and paste an example configuration for an adapter data source into the file.
For sample JSON, see the data source examples below.
-
Update the example JSON parameters for your environment.
For a table of all available parameters, see the data source parameters section below.
-
Save the file. For example, as ConfigureDataSource.json.
-
Open a command line session. Change the directory to the location of ConfigureDataSource.json.
-
Enter the following cURL command (which uses the PUT method) to initialize the data source configuration.
curl -d "@ConfigureDataSource.json" -H "Content-Type: application/json" -X PUT "http://localhost:5590/api/v1/configuration/AzureEventHubs1/DataSource"
Note: If you installed the adapter to listen on a non-default port, update 5590 to the port number you used.
If you use a component ID other than adapter1, update the endpoint with your chosen component ID.
For a list of other REST operations you can perform, like updating or deleting a data source configuration, see the REST URLs section below.
-
Configure Data selection.
Data source schema
The full schema definition for the adapter data source configuration is in the EventHubs_DataSource_schema.json file located in one of the following folders:
-
Windows: %ProgramFiles%\osisoft\Adapters\EventHubs\Schemas
-
Linux: /opt/osisoft/Adapters/EventHubs/Schemas
Data source parameters
The following parameters are available for configuring an Azure Event Hubs data source:
|
Parameter |
Required |
Type |
Description |
|---|---|---|---|
|
streamIdPrefix |
Optional |
string |
Specifies what prefix is used for Stream IDs. The naming convention is {StreamIdPrefix}{StreamId}. An empty string means no prefix will be added to the Stream IDs and names. A null value defaults to ComponentID followed by a period. For example: AzureEventHubs1.{Topic}.{ValueField} Note: Every time you change the StreamIdPrefix of a configured adapter, for example when you delete and add a data source, you need to restart the adapter for the changes to take place. New streams are created on adapter restart and pre-existing streams are no longer updated. Allowed value: any string |
|
defaultStreamIdPattern |
Optional |
string |
Specifies the default stream Id pattern to use. Possible parameters: {Topic}, {ValueField}, {DataType}. |
|
eventHubNamespaceConnectionString |
Required |
string |
The connection string for the Event Hub namespace. Default value: null |
|
consumerGroupName |
Required |
string |
The name of the consumer group as defined in the Azure Portal for event hub. Default value: "$Default" |
|
blobStorageConnectionString |
Required |
string |
The connection string for the Azure Blob Storage account which is used to store event
hub checkpoints. Default value: null |
|
checkpointBlobContainerName |
Required |
string |
The name of the container in the Blob Storage account used to store event hub checkpoints. Allowed value: 3-63 characters long; contains only letters, numbers, and dash characters per Azure restrictions. When using Azure Blob Storage as a checkpoint store, Microsoft recommends the following:
|
|
timeZone |
Optional |
string |
The time zone associated with the Event Hub namespace For the complete list, see Time Zone Database. |
Data source examples
The following are examples of valid adapter data source configurations:
Minimal data source configuration
[
{
"eventHubNamespaceConnectionString": "<AzureEventHubNamespaceConnectionString>",
"blobStorageConnectionString": "<AzureStorageAccountConnectionString>",
"consumerGroupName": "$Default",
"checkpointBlobContainerName": "<CheckpointContainer>"
}
]
Complete data source configuration
[
{
"streamIdPrefix": "EventHubs1.",
"defaultStreamIdPattern": "{EventHubName}.{ValueField}",
"eventHubNamespaceConnectionString": "<AzureEventHubNamespaceConnectionString>",
"blobStorageConnectionString": "<AzureStorageAccountConnectionString>",
"consumerGroupName": "$Default",
"checkpointBlobContainerName": "<CheckpointContainer>",
"timeZone": "America/Los_Angeles"
}
]
REST URLs
|
Relative URL |
HTTP verb |
Action |
|---|---|---|
|
api/v1/configuration/<ComponentId>/DataSource |
GET |
Retrieves the data source configuration. |
|
api/v1/configuration/<ComponentId>/DataSource |
POST |
Creates the data source configuration. The adapter starts collecting data after the following conditions are met:
|
|
api/v1/configuration/<ComponentId>/DataSource |
PUT |
Configures or updates the data source configuration. Overwrites any active data source configuration. If no configuration is active, the adapter starts collecting data after the following conditions are met:
|
|
api/v1/configuration/<ComponentId>/DataSource |
DELETE |
Deletes the data source configuration. After the request is received, the adapter stops collecting data. |
Note: Replace <ComponentId> with the Id of your adapter component, for example, adapter1.