This document maps every major Cosmos DB client configuration option across all five SDKs. Each table groups a category of options; rows represent a particular customization and columns show how each SDK exposes it. Cells contain concise option names; numbered notes below each table provide additional detail.
SDKs covered: .NET v3 · Java v4 · Go (azcosmos) · Python (azure-cosmos) · Rust (azure_data_cosmos)
- Authentication
- Connection & Networking
- Consistency
- Retry & Timeout
- Region & Availability
- Performance & Write Behavior
- Serialization
- Telemetry & Diagnostics
- Item CRUD Request Options
- Query Request Options
- Change Feed Options
- Transactional Batch / Bulk Options
- Throughput Configuration
- Dedicated Gateway / Integrated Cache
- Container Properties
- Indexing Policy
- Vector Embedding & Search
- Full-Text Search
- Patch Operations
- Change Feed Processor
- Cascading / Layering Behavior
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Account key | CosmosClient(endpoint, key) |
key(String) |
NewClientWithKey() |
CosmosClient(url, key) |
CosmosClient::with_key() ¹ |
| Connection string | CosmosClient(connStr) |
(parse manually) | NewClientFromConnectionString() |
from_connection_string() |
with_connection_string() ¹ |
| AAD / Entra ID token | CosmosClient(endpoint, TokenCredential) |
credential(TokenCredential) |
NewClient(endpoint, cred) |
CosmosClient(url, TokenCredential) |
CosmosClient::new() |
| Rotatable key | AzureKeyCredential |
AzureKeyCredential |
— | — | — |
| Resource token | Constructor param ² | resourceToken(String) |
— | credential dict ³ |
— |
| Permission-based | Via resource token | permissions(List) |
— | credential as iterable ³ |
— |
| Custom token resolver | — | authorizationTokenResolver() |
— | — | — |
Notes:
- Rust requires the
key_authfeature flag for key-based and connection-string constructors. - .NET accepts a resource token as the second parameter in the
(endpoint, authKeyOrResourceToken)overload. - Python detects credential type at runtime:
str→ master key;dict→ resource tokens; iterable of mappings → permission feed;TokenCredential→ AAD.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Connection mode | ConnectionMode ¹ |
directMode() / gatewayMode() |
Gateway only | connection_mode ² |
Gateway only |
| Request timeout | RequestTimeout |
DirectConnectionConfig.setNetworkRequestTimeout() |
Retry.TryTimeout |
connection_timeout |
request_timeout |
| Max connections | GatewayModeMaxConnectionLimit / MaxTcpConnectionsPerEndpoint |
setMaxConnectionsPerEndpoint() / setMaxConnectionPoolSize() |
(azcore transport) | (ConnectionPolicy) | (transport) |
| Idle connection timeout | IdleTcpConnectionTimeout |
setIdleConnectionTimeout() / setIdleEndpointTimeout() |
— | — | — |
| TCP open timeout | OpenTcpConnectionTimeout |
setConnectTimeout() |
— | — | — |
| Max requests per connection | MaxRequestsPerTcpConnection |
setMaxRequestsPerConnection() |
— | — | — |
| Port reuse | PortReuseMode |
— | — | — | — |
| Endpoint rediscovery on reset | EnableTcpConnectionEndpointRediscovery |
setConnectionEndpointRediscoveryEnabled() |
— | — | — |
| HTTP proxy | WebProxy |
GatewayConnectionConfig.setProxy() |
— | proxy_config / proxies |
— |
| Custom HTTP transport | HttpClientFactory |
— | Transport ³ |
transport |
client_options.transport |
| Custom pipeline policies | CustomHandlers |
addOperationPolicy() |
PerCallPolicies / PerRetryPolicies |
— | per_call_policies / per_try_policies |
| User-Agent suffix | ApplicationName |
userAgentSuffix() |
Telemetry.ApplicationID |
user_agent_suffix |
application_name |
| TLS cert validation | ServerCertificateCustomValidationCallback |
— | — | connection_verify / ssl_config |
— |
| Connection sharing across clients | — | connectionSharingAcrossClientsEnabled() |
— | — | — |
| HTTP/2 | — | Http2ConnectionConfig ⁴ |
— | — | — |
Notes:
- .NET supports
Direct(TCP) andGateway(HTTPS). Direct is the default. - Python only supports
Gatewaymode; the field exists but only Gateway is implemented. - Go inherits transport configuration from
azcore.ClientOptions. - Java HTTP/2 support is a Beta feature nested inside
GatewayConnectionConfig.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Client-level default | CosmosClientOptions.ConsistencyLevel |
consistencyLevel() |
(account default) ¹ | consistency_level |
consistency_level |
| Per-request override | *RequestOptions.ConsistencyLevel |
setConsistencyLevel() ² |
*.ConsistencyLevel ³ |
consistency_level kwarg |
ItemOptions.consistency_level / QueryOptions.consistency_level |
| Read consistency strategy | — | readConsistencyStrategy() ⁴ |
— | — | — |
| Session token (per-request) | *.SessionToken |
setSessionToken() |
*.SessionToken |
session_token |
session_token |
| Auto session capture override | — | sessionCapturingOverrideEnabled() |
— | — | — |
Notes:
- Go has no client-level consistency option; it always uses the account default. Override is only at the per-request level.
- Java supports per-request consistency override on item, query, batch, readMany, and stored procedure request options.
- Go supports per-request override on
ItemOptions,QueryOptions,TransactionalBatchOptions, andReadManyOptions. - Java's
ReadConsistencyStrategyis a Beta feature that provides additional strategies (LATEST_COMMITTED,GLOBAL_STRONG) and overridesConsistencyLevelwhen set.
All SDKs enforce the rule that consistency can only be weakened (relaxed) at the request level, never strengthened beyond the account setting.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| 429 max retry attempts | MaxRetryAttemptsOnRateLimitedRequests (9) |
setMaxRetryAttemptsOnThrottledRequests() (9) |
(azcore) Retry.MaxRetries (3) |
retry_total (9) |
RetryOptions::none() ¹ |
| 429 max wait time | MaxRetryWaitTimeOnRateLimitedRequests (30 s) |
setMaxRetryWaitTime() (30 s) |
Retry.MaxRetryDelay (60 s) |
retry_backoff_max (30 s) |
(internal) |
| Retry delay / backoff | (internal: 1 s initial) | (internal) | Retry.RetryDelay (800 ms) |
retry_backoff_factor / retry_fixed_interval |
(N/A) |
| Retryable status codes | (internal) | (internal) | Retry.StatusCodes |
retry_on_status_codes |
(internal) |
| Custom retry predicate | — | — | Retry.ShouldRetry |
— | — |
| Session retry options | SessionRetryOptions ² |
SessionRetryOptions ³ |
(internal) | — | session_retry_options |
| Non-idempotent write retry | — | NonIdempotentWriteRetryOptions |
— | retry_write |
— |
| End-to-end latency policy | — | CosmosEndToEndOperationLatencyPolicyConfig ⁴ |
— | — | — |
| Per-request timeout | RequestTimeout (6 s) |
setNetworkRequestTimeout() (5 s) |
Retry.TryTimeout (0) |
timeout kwarg |
request_timeout |
Notes:
- Rust sets
RetryOptions::none()on the Azure Core pipeline and handles retries internally within its own Cosmos-specific retry policy. - .NET
SessionRetryOptionscontrolsMinInRegionRetryTime,MaxInRegionRetryCount, andRemoteRegionPreferredfor 404/1002 errors. - Java
SessionRetryOptionsaddsregionSwitchHint(LOCAL_REGION_PREFERRED/REMOTE_REGION_PREFERRED),minTimeoutPerRegion, andmaxRetriesPerRegion. - Java's end-to-end latency policy wraps a total operation timeout plus an optional availability strategy for cross-region hedging.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Preferred regions | ApplicationPreferredRegions |
preferredRegions() |
PreferredRegions |
preferred_locations |
application_preferred_regions |
| Application region | ApplicationRegion ¹ |
— | — | — | application_region |
| Excluded regions (client) | — ² | excludedRegionsSupplier() |
— | excluded_locations |
excluded_regions |
| Excluded regions (per-request) | RequestOptions.ExcludeRegions |
setExcludedRegions() |
— | excluded_locations kwarg |
ItemOptions.excluded_regions |
| Endpoint discovery | (always on unless LimitToEndpoint) |
endpointDiscoveryEnabled() |
— | enable_endpoint_discovery |
— |
| Multi-write regions | — ³ | multipleWriteRegionsEnabled() |
— | multiple_write_locations |
— |
| Limit to single endpoint | LimitToEndpoint |
— | — | — | — |
| Custom init endpoints | AccountInitializationCustomEndpoints |
— | — | — | account_initialization_custom_endpoints |
| Cross-region hedging | AvailabilityStrategy ⁴ |
ThresholdBasedAvailabilityStrategy ⁵ |
— | availability_strategy_config ⁶ |
— |
| Read fallback | — | readRequestsFallbackEnabled() |
— | — | — |
Notes:
ApplicationRegionspecifies where the application itself is running, allowing the SDK and backend to negotiate the optimal region order from that location. Mutually exclusive withApplicationPreferredRegions.- .NET has no client-level excluded regions; it uses per-request
ExcludeRegionswhich subtracts from the preferred list. - .NET auto-detects multi-write; Java exposes explicit
multipleWriteRegionsEnabled(). - .NET
CrossRegionHedgingStrategyacceptsthreshold,thresholdStep, andenableMultiWriteRegionHedge. Can be set per-request or disabled withDisabledStrategy(). - Java hedging is configured via
ThresholdBasedAvailabilityStrategy(threshold 500 ms, step 100 ms) nested inside the end-to-end latency policy. - Python hedging uses a dict with
threshold_ms(default 500) andthreshold_steps_ms(default 100). Per-request override withNonedisables hedging.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Content response on write (client) | EnableContentResponseOnWrite |
contentResponseOnWriteEnabled() |
EnableContentResponseOnWrite |
no_response_on_write ¹ |
— |
| Content response on write (request) | ItemRequestOptions.EnableContentResponseOnWrite |
setContentResponseOnWriteEnabled() |
ItemOptions.EnableContentResponseOnWrite |
no_response kwarg |
content_response_on_write_enabled |
| Bulk execution mode | AllowBulkExecution |
CosmosBulkExecutionOptions ² |
— | — | — |
| Priority level (client) | PriorityLevel |
ThroughputControlGroupConfig.priorityLevel() |
— | priority |
priority |
| Priority level (request) | RequestOptions.PriorityLevel |
(via throughput control group) | — | priority kwarg |
ItemOptions.priority / QueryOptions.priority |
| Throughput bucket (client) | — | ThroughputControlGroupConfig.throughputBucket() |
— | throughput_bucket |
throughput_bucket |
| Throughput bucket (request) | — | — | — | throughput_bucket kwarg |
ItemOptions.throughput_bucket / QueryOptions.throughput_bucket |
| Proactive connection warm-up | CreateAndInitializeAsync() ³ |
openConnectionsAndInitCaches() ⁴ |
— | — | — |
Notes:
- Python inverts the polarity:
no_response_on_write=Truedisables the response body (equivalent to .NET/Java/GoEnableContentResponseOnWrite=false). - Java bulk execution is configured via
CosmosBulkExecutionOptionswithinitialMicroBatchSize,maxMicroBatchSize, andmaxMicroBatchConcurrency. - .NET
CreateAndInitializeAsyncaccepts a list of(databaseId, containerId)pairs and warms caches/connections before returning the client. - Java
CosmosContainerProactiveInitConfigsupportsproactiveConnectionRegionsCount(max 5) andaggressiveWarmupDuration.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Custom serializer | Serializer / CosmosSerializer |
customItemSerializer() ¹ |
— | — | — |
| Serializer options | SerializerOptions ² |
— | — | — | — |
| System.Text.Json | UseSystemTextJsonSerializerWithOptions |
— | — | — | — |
| LINQ naming policy | CosmosLinqSerializerOptions |
— | — | — | — |
| Per-request serializer | — | setCustomItemSerializer() ¹ |
— | — | — |
Notes:
- Java's
CosmosItemSerializeris abstract; the per-request override is available on item, query, change feed, batch, bulk, and readMany options. - .NET
CosmosSerializationOptionsprovidesIgnoreNullValues,Indented, andPropertyNamingPolicy(DefaultorCamelCase). All three serializer settings are mutually exclusive.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Distributed tracing | DisableDistributedTracing |
tracingOptions() / enableTransportLevelTracing() |
TracingProvider |
— | instrumentation |
| Metrics | IsClientMetricsEnabled / OperationMetricsOptions ¹ |
CosmosMicrometerMetricsOptions ² |
— | — | — |
| Diagnostics thresholds (client) | CosmosThresholdOptions |
CosmosDiagnosticsThresholds |
— | — | — |
| Diagnostics thresholds (request) | RequestOptions.CosmosThresholdOptions |
setDiagnosticsThresholds() |
— | — | — |
| Query text in traces | QueryTextMode ³ |
showQueryMode() ³ |
— | — | — |
| Logging options | — | — | Logging ⁴ |
enable_diagnostics_logging / logger |
logging ⁵ |
| Client telemetry to service | DisableSendingMetricsToService |
— | — | — | — |
| Client correlation ID | — | clientCorrelationId() |
— | — | — |
| Diagnostics handler | — | diagnosticsHandler() |
— | — | — |
| Response hook | — | — | — | response_hook |
— |
Notes:
- .NET metrics are a Preview feature with
OperationMetricsOptionsandNetworkMetricsOptions. - Java provides fine-grained Micrometer integration: per-meter options, tag suppression, histogram toggles, metric categories, and sampling rates.
- Both .NET and Java expose three modes:
None,ParameterizedOnly/PARAMETERIZED,All/ALL. - Go logging is via
azcoreLogOptions:IncludeBody,AllowedHeaders,AllowedQueryParams. - Rust logging is via
azure_coreLoggingOptions, with Cosmos-specific allowed headers automatically configured.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Partition key | ItemRequestOptions (implicit) |
setPartitionKey() |
(method param) | partition_key |
(method param) |
| ETag / If-Match | IfMatchEtag |
setIfMatchETag() |
IfMatchEtag |
etag + match_condition |
if_match_etag |
| If-None-Match | IfNoneMatchEtag |
setIfNoneMatchETag() |
— | etag + match_condition ¹ |
— |
| Pre-triggers | PreTriggers |
setPreTriggerInclude() |
PreTriggers |
pre_trigger_include |
pre_triggers |
| Post-triggers | PostTriggers |
setPostTriggerInclude() |
PostTriggers |
post_trigger_include |
post_triggers |
| Indexing directive | IndexingDirective |
setIndexingDirective() |
IndexingDirective |
indexing_directive |
indexing_directive |
| Session token | SessionToken |
setSessionToken() |
SessionToken |
session_token |
session_token |
| Consistency override | ConsistencyLevel |
setConsistencyLevel() |
ConsistencyLevel |
— ² | consistency_level |
| Content on write | EnableContentResponseOnWrite |
setContentResponseOnWriteEnabled() |
EnableContentResponseOnWrite |
no_response |
content_response_on_write_enabled |
| Dedicated gateway cache | DedicatedGatewayRequestOptions |
setDedicatedGatewayRequestOptions() |
DedicatedGatewayRequestOptions |
max_integrated_cache_staleness_in_ms |
— |
| Priority | PriorityLevel |
(via throughput control) | — | priority |
priority |
| Excluded regions | ExcludeRegions |
setExcludedRegions() |
— | excluded_locations |
excluded_regions |
| Custom headers | AddRequestHeaders |
— | — | initial_headers |
custom_headers |
| Auto-ID generation | — | — | — | enable_automatic_id_generation |
— |
| Filter predicate (patch) | PatchItemRequestOptions.FilterPredicate |
setFilterPredicate() |
— | filter_predicate |
PatchDocument.condition |
| Availability strategy | AvailabilityStrategy |
setCosmosEndToEndOperationLatencyPolicyConfig() |
— | availability_strategy_config |
— |
| Throughput control group | — | setThroughputControlGroupName() |
— | throughput_bucket |
throughput_bucket |
Notes:
- Python uses
match_condition(fromazure.core) paired withetagto express both If-Match and If-None-Match. - Python does not expose per-item-write consistency override; it's available on read/query operations via
consistency_level.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Max items per page | MaxItemCount |
setMaxItemCount() ¹ |
PageSizeHint |
max_item_count |
— |
| Partition key | PartitionKey |
setPartitionKey() |
(method param) | partition_key |
(method param) |
| Feed range | — | setFeedRange() |
— | feed_range |
— |
| Cross-partition query | (automatic) | (automatic) | EnableCrossPartitionQuery |
enable_cross_partition_query |
(automatic) |
| Scan in query | EnableScanInQuery |
setScanInQueryEnabled() |
EnableScanInQuery |
enable_scan_in_query |
— |
| Index metrics | PopulateIndexMetrics |
setIndexMetricsEnabled() |
PopulateIndexMetrics |
populate_index_metrics |
— |
| Query metrics | — | setQueryMetricsEnabled() |
— | populate_query_metrics |
— |
| Continuation token limit | ResponseContinuationTokenLimitInKb |
setResponseContinuationTokenLimitInKb() |
ResponseContinuationTokenLimitInKB |
continuation_token_limit |
— |
| Max parallelism | MaxConcurrency |
setMaxDegreeOfParallelism() |
— | — | — |
| Max buffered items | MaxBufferedItemCount |
setMaxBufferedItemCount() |
— | — | — |
| Query parameters | (LINQ / SQL param) | (SQL param) | QueryParameters |
parameters |
— ² |
| Session token | SessionToken |
setSessionToken() |
SessionToken |
session_token |
session_token |
| Consistency override | ConsistencyLevel |
setConsistencyLevel() |
ConsistencyLevel |
consistency_level |
consistency_level |
| Dedicated gateway cache | DedicatedGatewayRequestOptions |
setDedicatedGatewayRequestOptions() |
DedicatedGatewayRequestOptions |
max_integrated_cache_staleness_in_ms |
— |
| Optimistic direct execution | EnableOptimisticDirectExecution |
— | — | — | — |
| Low-precision ORDER BY | EnableLowPrecisionOrderBy |
— | — | — | — |
| Full-text score scope | FullTextScoreScope |
— | — | — | — |
| Query name (telemetry) | — | setQueryName() |
— | — | — |
| External query engine | — | — | QueryEngine ³ |
— | — |
Notes:
- Java uses
setMaxItemCount()onCosmosChangeFeedRequestOptions; for queries it's set viaCosmosQueryRequestOptionsor the unifiedCosmosRequestOptions. - Rust passes query parameters directly in the query method call, not via options.
- Go's
QueryEngineis a Preview feature for client-side cross-partition query processing.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Feed mode | ChangeFeedMode.LatestVersion / .AllVersionsAndDeletes |
Factory method ¹ | — | mode ² |
— |
| Start from beginning | Via ChangeFeedStartFrom |
createForProcessingFromBeginning() |
— | start_time="Beginning" |
— |
| Start from now | Via ChangeFeedStartFrom |
createForProcessingFromNow() |
— | start_time="Now" |
— |
| Start from time | Via ChangeFeedStartFrom |
createForProcessingFromPointInTime() |
StartFrom |
start_time=datetime |
— |
| Resume from continuation | Via ChangeFeedStartFrom |
createForProcessingFromContinuation() |
Continuation |
continuation |
— |
| Max items per page | PageSizeHint |
setMaxItemCount() |
MaxItemCount |
max_item_count |
— |
| Feed range | Via ChangeFeedStartFrom |
Factory param | FeedRange |
feed_range |
— |
| Partition key | Via ChangeFeedStartFrom |
— | PartitionKey |
partition_key |
— |
| Priority | — | — | — | priority |
— |
| Prefetch pages | — | setMaxPrefetchPageCount() |
— | — | — |
Notes:
- Java change feed options are created via factory methods that determine the mode and starting point:
createForProcessingFromBeginning(FeedRange),createForProcessingFromNow(FeedRange),createForProcessingFromContinuation(String),createForProcessingFromPointInTime(Instant, FeedRange). - Python supports
"LatestVersion"and"AllVersionsAndDeletes"via themodekeyword argument.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Batch consistency | TransactionalBatchRequestOptions.ConsistencyLevel |
CosmosBatchRequestOptions.setConsistencyLevel() |
TransactionalBatchOptions.ConsistencyLevel |
— | — |
| Batch session token | TransactionalBatchRequestOptions.SessionToken |
CosmosBatchRequestOptions.setSessionToken() |
TransactionalBatchOptions.SessionToken |
— | — |
| Batch content on write | (inherits from client) | — | TransactionalBatchOptions.EnableContentResponseOnWrite |
— | — |
| Per-batch-item ETag | TransactionalBatchItemRequestOptions.IfMatchEtag |
CosmosBatchItemRequestOptions.setIfMatchETag() |
TransactionalBatchItemOptions.IfMatchETag |
— | — |
| Per-batch-item indexing | TransactionalBatchItemRequestOptions.IndexingDirective |
— | — | — | — |
| Per-batch-item content on write | TransactionalBatchItemRequestOptions.EnableContentResponseOnWrite |
— | — | — | — |
| Batch patch filter | TransactionalBatchPatchItemRequestOptions.FilterPredicate |
CosmosBatchPatchItemRequestOptions.setFilterPredicate() |
— | — | — |
| Bulk micro-batch size | — | setInitialMicroBatchSize() / setMaxMicroBatchSize() |
— | — | — |
| Bulk concurrency | — | setMaxMicroBatchConcurrency() |
— | — | — |
| Bulk item content on write | — | CosmosBulkItemRequestOptions.setContentResponseOnWriteEnabled() |
— | — | — |
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Manual throughput | ThroughputProperties.CreateManualThroughput() |
ThroughputProperties.createManualThroughput() |
NewManualThroughputProperties() |
offer_throughput (int) |
ThroughputProperties::manual() |
| Autoscale throughput | ThroughputProperties.CreateAutoscaleThroughput() |
ThroughputProperties.createAutoscaledThroughput() |
NewAutoscaleThroughputProperties() |
ThroughputProperties(auto_scale_max_throughput=) |
ThroughputProperties::autoscale() |
| Autoscale increment | — | — | NewAutoscaleThroughputPropertiesWithIncrement() |
auto_scale_increment_percent |
increment_percent param |
| Throughput control groups | — | ThroughputControlGroupConfig ¹ |
— | — | — |
| Global throughput control | — | GlobalThroughputControlConfig ² |
— | — | — |
| ETag (conditional update) | ThroughputProperties.ETag |
(read-only) | ThroughputOptions.IfMatchEtag |
— | — |
Notes:
- Java throughput control groups allow setting per-group
targetThroughput,targetThroughputThreshold,priorityLevel, andthroughputBucket. - Java global throughput control coordinates across clients using a lease container with configurable
controlItemRenewIntervalandcontrolItemExpireInterval.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Max cache staleness | MaxIntegratedCacheStaleness |
setMaxIntegratedCacheStaleness() |
MaxIntegratedCacheStaleness |
max_integrated_cache_staleness_in_ms |
(via custom headers) ¹ |
| Bypass cache | BypassIntegratedCache |
setIntegratedCacheBypassed() |
BypassIntegratedCache |
— | (via custom headers) ¹ |
| Shard key | — | setShardKey() |
— | — | — |
| Scope | Per-request ² | Per-request | Per-request ³ | Per-request | — |
Notes:
- Rust does not have a dedicated gateway options struct; dedicated gateway headers can be set via
custom_headersonCosmosClientOptionsor per-request options. - .NET
DedicatedGatewayRequestOptionsis available onItemRequestOptionsandQueryRequestOptions. - Go
DedicatedGatewayRequestOptionsis available onItemOptions,QueryOptions, andReadManyOptions.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Container ID | Id |
setId() |
ID |
id |
id |
| Partition key definition | PartitionKeyPath / PartitionKeyPaths |
setPartitionKeyDefinition() |
PartitionKeyDefinition |
partition_key=PartitionKey(path=) |
partition_key: PartitionKeyDefinition |
| Hierarchical partition keys | PartitionKeyPaths (list) |
PartitionKeyDefinition (multi-path) |
MultiHash kind |
PartitionKey(path=[...], kind="MultiHash") |
PartitionKeyDefinition::from(tuple) |
| Default TTL | DefaultTimeToLive |
setDefaultTimeToLiveInSeconds() |
DefaultTimeToLive |
default_ttl |
default_ttl |
| Analytical store TTL | AnalyticalStoreTimeToLiveInSeconds |
setAnalyticalStoreTimeToLiveInSeconds() |
AnalyticalStoreTimeToLiveInSeconds |
analytical_storage_ttl |
analytical_storage_ttl |
| Indexing policy | IndexingPolicy |
setIndexingPolicy() |
IndexingPolicy |
indexing_policy |
indexing_policy |
| Unique key policy | UniqueKeyPolicy |
setUniqueKeyPolicy() |
UniqueKeyPolicy |
unique_key_policy |
unique_key_policy |
| Conflict resolution | ConflictResolutionPolicy |
setConflictResolutionPolicy() |
ConflictResolutionPolicy |
conflict_resolution_policy |
conflict_resolution_policy |
| Vector embedding policy | VectorEmbeddingPolicy |
setVectorEmbeddingPolicy() |
VectorEmbeddingPolicy |
vector_embedding_policy |
vector_embedding_policy |
| Full-text policy | FullTextPolicy |
setFullTextPolicy() |
FullTextPolicy |
full_text_policy |
— |
| Change feed policy | ChangeFeedPolicy |
setChangeFeedPolicy() |
— | change_feed_policy |
— |
| Client encryption policy | ClientEncryptionPolicy |
setClientEncryptionPolicy() |
— | — | — |
| Computed properties | ComputedProperties |
setComputedProperties() |
— | computed_properties |
— |
| Geospatial config | GeospatialConfig |
— | — | — | — |
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Automatic indexing | Automatic |
setAutomatic() |
Automatic |
(via dict) | automatic |
| Indexing mode | IndexingMode ¹ |
setIndexingMode() ¹ |
IndexingMode ² |
(via dict) | indexing_mode ² |
| Included paths | IncludedPaths |
setIncludedPaths() |
IncludedPaths |
(via dict) | included_paths |
| Excluded paths | ExcludedPaths |
setExcludedPaths() |
ExcludedPaths |
(via dict) | excluded_paths |
| Composite indexes | CompositeIndexes |
setCompositeIndexes() |
CompositeIndexes |
(via dict) | composite_indexes |
| Spatial indexes | SpatialIndexes |
setSpatialIndexes() |
SpatialIndexes |
(via dict) | spatial_indexes |
| Vector indexes | VectorIndexes |
setVectorIndexes() |
VectorIndexes |
(via dict) | vector_indexes |
| Full-text indexes | FullTextIndexes |
setCosmosFullTextIndexes() |
FullTextIndexes |
(via dict) | — |
Notes:
- .NET and Java support
Consistent,Lazy(deprecated), andNone. - Go and Rust support
ConsistentandNoneonly (noLazy).
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Embedding path | Embedding.Path |
setPath() |
VectorEmbedding.Path |
path (dict) |
VectorEmbedding.path |
| Data type | VectorDataType ¹ |
CosmosVectorDataType ¹ |
VectorDataType ² |
(dict value) | VectorDataType ³ |
| Dimensions | Embedding.Dimensions |
setEmbeddingDimensions() |
VectorEmbedding.Dimensions |
(dict value) | VectorEmbedding.dimensions |
| Distance function | DistanceFunction ⁴ |
CosmosVectorDistanceFunction ⁴ |
VectorDistanceFunction ⁴ |
(dict value) | VectorDistanceFunction ⁴ |
| Index type | VectorIndexType ⁵ |
CosmosVectorIndexSpec.setType() |
VectorIndex.Type |
(dict value) | VectorIndexType |
| Quantizer type | VectorIndexPath.QuantizerType |
setQuantizerType() |
— | — | — |
| Quantization byte size | VectorIndexPath.QuantizationByteSize |
setQuantizationSizeInBytes() |
— | — | — |
| Search list size | VectorIndexPath.IndexingSearchListSize |
setIndexingSearchListSize() |
— | — | — |
| Shard key | VectorIndexPath.VectorIndexShardKey |
setVectorIndexShardKeys() |
— | — | — |
Notes:
- .NET:
Float32,Float16,Uint8,Int8. Java:UINT8,INT8,FLOAT16,FLOAT32. - Go:
float32,int8,uint8. - Rust:
Float16,Float32,Uint8,Int8. - All SDKs support
Cosine,Euclidean, andDotProduct. - All SDKs support
Flat,QuantizedFlat, andDiskANNindex types.
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Default language | FullTextPolicy.DefaultLanguage |
setDefaultLanguage() |
FullTextPolicy.DefaultLanguage |
(dict value) | — |
| Per-path language | FullTextPath.Language |
CosmosFullTextPath.setLanguage() |
FullTextPath.Language |
(dict value) | — |
| Full-text indexes | FullTextIndexPath |
CosmosFullTextIndex |
FullTextIndex |
(dict value) | — |
| Full-text score scope | FullTextScoreScope ¹ |
— | — | — | — |
Notes:
- .NET-only:
FullTextScoreScopecontrols BM25 statistics scope (Globalacross all partitions orLocalper partition).
| Operation | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Add | PatchOperation.Add<T>() |
CosmosPatchOperations.add() |
— | (via body) | PatchOperation::Add |
| Remove | PatchOperation.Remove() |
CosmosPatchOperations.remove() |
— | (via body) | PatchOperation::Remove |
| Replace | PatchOperation.Replace<T>() |
CosmosPatchOperations.replace() |
— | (via body) | PatchOperation::Replace |
| Set | PatchOperation.Set<T>() |
CosmosPatchOperations.set() |
— | (via body) | PatchOperation::Set |
| Increment | PatchOperation.Increment() |
CosmosPatchOperations.increment() |
— | (via body) | PatchOperation::Increment |
| Move | PatchOperation.Move() |
CosmosPatchOperations.move() |
— | (via body) | PatchOperation::Move |
| Conditional filter | PatchItemRequestOptions.FilterPredicate |
setFilterPredicate() |
— | filter_predicate |
PatchDocument.condition |
| Customization | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Instance / host name | WithInstanceName() |
hostName() |
— | — | — |
| Lease container | WithLeaseContainer() |
leaseContainer() |
— | — | — |
| In-memory lease | WithInMemoryLeaseContainer() |
— | — | — | — |
| Max items per poll | WithMaxItems() |
setMaxItemCount() |
— | — | — |
| Poll interval | WithPollInterval() (5 s) |
setFeedPollDelay() (5 s) |
— | — | — |
| Start time | WithStartTime() |
setStartTime() |
— | — | — |
| Lease renew interval | WithLeaseConfiguration() (17 s) |
setLeaseRenewInterval() (17 s) |
— | — | — |
| Lease acquire interval | WithLeaseConfiguration() (13 s) |
setLeaseAcquireInterval() (13 s) |
— | — | — |
| Lease expiration | WithLeaseConfiguration() (60 s) |
setLeaseExpirationInterval() (60 s) |
— | — | — |
| Error notification | WithErrorNotification() |
— | — | — | — |
| Lease prefix | — | setLeasePrefix() |
— | — | — |
| Min/max scale count | — | setMinScaleCount() / setMaxScaleCount() |
— | — | — |
| Scheduler | — | setScheduler() |
— | — | — |
Note: Change Feed Processor is a high-level abstraction only available in .NET and Java. Go, Python, and Rust provide lower-level change feed iteration but not the processor pattern.
The table below summarizes which options support cascading (setting a default at a broad level that can be overridden at a narrower level) across all SDKs.
| Option | .NET | Java | Go | Python | Rust |
|---|---|---|---|---|---|
| Consistency level | Client → Request ¹ | Client → Request ¹ | Account → Request ¹ | Client → Operation ¹ | Client → Request ¹ |
| Content response on write | Client → Request | Client → Request | Client → Request | Client → Operation | (request only) |
| Priority level | Client → Request | (via throughput control) | — | Client → Operation | Client → Request |
| Throughput bucket | — | (via throughput control) | — | Client → Operation | Client → Request |
| Excluded regions | (request only) ² | Client → Request | — | Client → Operation | Client → Request ³ |
| Availability / hedging strategy | Client → Request ⁴ | Client → Request ⁵ | — | Client → Operation ⁶ | — |
| Session token | (auto + request override) | (auto + request override) | (auto + request override) | (auto + request override) | (request only) |
| Diagnostics thresholds | Client → Request | Client → Request | — | — | — |
| Serializer | (client only) | Client → Request | — | — | — |
| Indexing directive | Container → Request ⁷ | Container → Request ⁷ | Container → Request ⁷ | Container → Request ⁷ | Container → Request ⁷ |
| Custom headers | (request only) | — | (context-based) | (request only) | Client → Request ⁸ |
Notes:
- All SDKs enforce the rule that consistency can only be weakened at a lower level. The override chain is: Account default → Client override → Per-request override.
- .NET does not have client-level excluded regions;
ExcludeRegionsonRequestOptionssubtracts from the preferred region list. - Rust:
ItemOptions.excluded_regions = Noneinherits from client;Some(vec![])explicitly clears exclusions for that request. - .NET:
RequestOptions.AvailabilityStrategyoverrides client; setDisabledStrategy()to opt out per-request. - Java: end-to-end latency policy (which wraps the availability strategy) can be overridden per-request.
- Python:
availability_strategy_config=Noneat the operation level explicitly disables hedging for that request. - All SDKs: the container's
IndexingPolicydefines the default; per-itemIndexingDirective(Include/Exclude) overrides it for individual writes. - Rust:
custom_headersat the client level fill in gaps; request-levelcustom_headerstake priority per header name.
┌────────────────────────────────────────────────────────┐
│ Account Level (server-side) │
│ • Default consistency level │
│ • Regions & multi-write configuration │
├────────────────────────────────────────────────────────┤
│ Client Level │
│ • Consistency level (weaken only) │
│ • Preferred/excluded regions │
│ • Content response on write │
│ • Priority level, throughput bucket │
│ • Retry & timeout policies │
│ • Serialization, telemetry, diagnostics thresholds │
│ • Connection mode & transport settings │
│ • Hedging / availability strategy │
│ • Custom headers (Rust, Python, .NET) │
├────────────────────────────────────────────────────────┤
│ Database / Container Level │
│ • Throughput (manual / autoscale) │
│ • Container schema: partition key, TTL, indexing, │
│ unique keys, vector, full-text, conflict resolution │
├────────────────────────────────────────────────────────┤
│ Request Level (per-operation) │
│ • Consistency level (weaken only) │
│ • Session token │
│ • Content response on write │
│ • Priority, throughput bucket │
│ • Excluded regions │
│ • Indexing directive (overrides container policy) │
│ • ETag / conditional access │
│ • Pre/post triggers │
│ • Dedicated gateway cache options │
│ • Diagnostics thresholds (.NET, Java) │
│ • Serializer (Java only) │
│ • Custom headers │
│ • Availability strategy override (.NET, Java, Python) │
└────────────────────────────────────────────────────────┘
Generated from analysis of individual SDK reports: .NET · Java · Go · Python · Rust