Skip to main content

Azure Cosmos DB

The Azure Cosmos DB data source type in ArcGIS Velocity reads records from database collections stored in Azure Cosmos DB.

Example

A researcher wants to load data from a database collection stored in Azure Cosmos DB into Velocity to perform analysis.

Usage notes

Consider the following when using the data source:

  • The master key is encrypted the first time the analytic is saved and is stored in an encrypted state.

  • A where clause can be specified to restrict the records loaded from the Azure Cosmos DB container collection.

  • Analytic run time variables can be specified in the Where clause parameter to only load new features from the Azure Cosmos DB container collection for each run.

Parameters

The following are the parameters for the data source:

Parameter

Description

Data type

Endpoint

The endpoint URL for Azure Cosmos DB, for example, https://yourCosmosDBAccountName.documents.azure.com:443/.

String

Master key

The primary key for Azure Cosmos DB.

String

Database

The name of the Azure Cosmos DB container that contains the collection of data to read.

String

Collection

The name of the Azure Cosmos DB collection in the specified container that contains the data.

String

Where clause (optional)

Restrict the features loaded from the Azure Cosmos DB container collection.

Use a simple query format. For example, if a numeric field named course exists in the dataset, you can specify a where clause of course = 49.5845184; if a string field named user_id exists in the dataset, you can specify a where clause of user_id = 'pete1234'.

In the Azure Cosmos DB interface, these queries are in the form SELECT * FROM c WHERE c.user_id = 'pete1234'; however, you must specify user_id = 'pete1234' for this parameter in Velocity.

When querying string fields, use single quotation marks around text that is part of the query, for example, road_type = 'asphalt'.

String

Considerations and limitations

Consider the following when using the data source:

  • When specifying a where clause to filter string values, wrap text values in single quotation marks.

  • When specifying date fields, only the following configurations are supported for this data source:

    • Epoch seconds such as 1616673883

    • Epoch milliseconds such as 1616673883000

    • ISO 8601 datetime format with no time zone such as 2021-03-25T12:05:34

    • ISO 8601 datetime format with a time zone such as 2021-03-25T12:05:34+0000

    • String dates in the format (milliseconds are optional) yyyy-MM-dd HH:mm:ss[.fffffffff] such as 2021-03-25 12:05:34 or 2021-03-25 12:05:34.435