azure_cosmosdb
EXPERIMENTAL
This component is experimental and therefore subject to change or removal outside of major version releases.
Executes a SQL query against Azure CosmosDB and creates a batch of messages from each page of items.
Introduced in version 1.0.0.
- Common
- Advanced
# Common config fields, showing default values
input:
label: ""
azure_cosmosdb:
endpoint: https://localhost:8081 # No default (optional)
account_key: '!!!SECRET_SCRUBBED!!!' # No default (optional)
connection_string: '!!!SECRET_SCRUBBED!!!' # No default (optional)
database: testdb # No default (required)
container: testcontainer # No default (required)
partition_keys_map: root = "blobfish" # No default (required)
query: SELECT c.foo FROM testcontainer AS c WHERE c.bar = "baz" AND c.timestamp < @timestamp # No default (required)
args_mapping: |- # No default (optional)
root = [
{ "Name": "@name", "Value": "bento" },
]
auto_replay_nacks: true
# All config fields, showing default values
input:
label: ""
azure_cosmosdb:
endpoint: https://localhost:8081 # No default (optional)
account_key: '!!!SECRET_SCRUBBED!!!' # No default (optional)
connection_string: '!!!SECRET_SCRUBBED!!!' # No default (optional)
database: testdb # No default (required)
container: testcontainer # No default (required)
partition_keys_map: root = "blobfish" # No default (required)
query: SELECT c.foo FROM testcontainer AS c WHERE c.bar = "baz" AND c.timestamp < @timestamp # No default (required)
args_mapping: |- # No default (optional)
root = [
{ "Name": "@name", "Value": "bento" },
]
batch_count: -1
auto_replay_nacks: true
Cross-partition Queries
Cross-partition queries are currently not supported by the underlying driver. For every query, the PartitionKey value(s) must be known in advance and specified in the config. See details here.
Credentials
You can use one of the following authentication mechanisms:
- Set the
endpoint
field and theaccount_key
field - Set only the
endpoint
field to use DefaultAzureCredential - Set the
connection_string
field
Metadata
This component adds the following metadata fields to each message:
- activity_id
- request_charge
You can access these metadata fields using function interpolation.
Examples
- Query container
Execute a parametrized SQL query to select documents from a container.
input:
azure_cosmosdb:
endpoint: http://localhost:8080
account_key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
database: blobbase
container: blobfish
partition_keys_map: root = "AbyssalPlain"
query: SELECT * FROM blobfish AS b WHERE b.species = @species
args_mapping: |
root = [
{ "Name": "@species", "Value": "smooth-head" },
]