Examples

The following examples can be found on this page:

ADX Table

This example Application demonstrates how to read telemetry data from a table in an Azure Data Explorer instance using this Connector.
You can download the files here to try it out for yourself - adjusting the steps to use your own Azure credentials.
Refer to configuration to understand all configuration options of this Connector.

Step 1: Add the Connection

From the Properties blade of the widget to which the Azure Data Explorer Connector will be linked, a data grid in our example, select the Data Source tab.
Click the plus icon next to Data Source, then the plus icon next to Connection, and select the Azure Data Explorer Connector.

Step 2: Configure Server

Enter the authentication details: the Cluster Url, Tenant Id, Client Id, and Secret Key. In this case, tick to use variables.

Step 3: Configure Database

Select the database, table, primary key, and columns to return. In this case:
  • Database: TestDatabase
  • Table: TruckTelemetry table
  • Primary key: PumpId
  • Columns: ReadingNo, PumpId, PumpInletPressure, and Timestamp
If there is a need to select data from multiple tables, tick the Specify ADX Query option and provide the query in the ADX Query field.

Step 4: Use the Connection

Enter a name for the Connection, and click Save. In this case, set the name to Azure Data Explorer Connector.
Select the Connection that was just created, select the entity to read, and enter the Data Source name. Save the Data Source.
Note that the primary key is auto-populated once the entity is selected.

Step 5: Use the Data Source

Select the Data Source we just added, and save the Application.

Step 6: Results

Click the Launch button and view the results. Observe that telemetry data is returned from Azure Data Explorer.

Files

File
Link
Security Key
Application
ADX Connector.xapp
C0mp|ex123
See the Import, Export, and Clone - XMPro article for steps to import an Application.

ADX Query with Parameters

This example Application demonstrates how to read telemetry data from an Azure Data Explorer instance using an ADX Query with Query Parameters.
You can download the files here to try it out for yourself - adjusting the steps to use your own Azure credentials.
Refer to configuration to understand all configuration options of this Connector.

Step 1: Add the Connection

From the Properties blade of the widget to which the Azure Data Explorer Connector will be linked, a chart in our example, select the Data Source tab.
Click the plus icon next to Data Source, then the plus icon next to Connection, and select the Azure Data Explorer Connector.

Step 2: Configure Server

Enter the authentication details: the Cluster Url, Tenant ID, Client ID, and Secret Key. In this case, tick to use variables.

Step 3: Configure Database

Select the Database, ADX Query, Primary Key, and Columns to Return. In this case:
  • Database: TestDatabase
  • ADX Query: StormEvents | where StartTime > queryparam("StartDate","DateTime","2007-01-01") | where State in (queryparam("StateList","Dynamic","'ALABAMA','INDIANA'")) | take queryparam("NumRecords","Int","100")
  • Primary key: StartTime
  • Columns: StartTime and DamageProperty
Enter a name for the Connection, and click Save. In this case, set the name to ADX Connection.

Step 4: Use the Connection

Select the Connection that was just created, select the entity to read, and enter the Data Source name. Save the Data Source.
Note that the primary key is auto-populated once the entity is selected.

Step 5: Use the Data Source

Select the Data Source we just added.
Click the pencil icon next to Parameters to bind the query parameter values from the query entered in step 3.
Click the pencil icon next to Filter to enter criteria: 'DamageProperty' is less than 50000.
Save the Application.
Note: When query parameter values are not provided, the default values provided in the query are used.

Step 6: Configure Chart Data

Next, we'll add Data Series to the chart. Expand the Axes accordion, and set the X Axis' data type to Date Time.
In the Data accordion, click the plus icon next to Series. The series settings blade will open on the right. Set the name, color, X Axis Data, and Y Axis Data. In this case:
  • Name: Property Damage
  • Colour: Red
  • X Axis Data: Start Time
  • Y Axis Data: Damage Property
Click Apply and Close, and save the Application.

Step 7: Results

Click the Launch button and view the chart. Observe that the chart is populated with data from Azure Data Explorer.

Files

File
Link
Security Key
Application
ADX using Query Parameters Example.xapp
C0mp|ex123
See the Import, Export, and Clone - XMPro article for steps to import an Application.