File tree 1 file changed +9
-1
lines changed
src/Microsoft.Health.Fhir.CosmosDb/Features/Storage
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,16 @@ private CosmosClient CreateCosmosClientInternal(CosmosDataStoreConfiguration con
131
131
new CosmosClientBuilder ( host , _cosmosAccessTokenProviderFactory . Invoke ( ) . TokenCredential ) :
132
132
new CosmosClientBuilder ( host , key ) ;
133
133
134
+ if ( configuration . ConnectionMode == ConnectionMode . Gateway )
135
+ {
136
+ builder . WithConnectionModeGateway ( ) ;
137
+ }
138
+ else
139
+ {
140
+ builder . WithConnectionModeDirect ( enableTcpConnectionEndpointRediscovery : true ) ;
141
+ }
142
+
134
143
builder
135
- . WithConnectionModeDirect ( enableTcpConnectionEndpointRediscovery : true )
136
144
. WithCustomSerializer ( new FhirCosmosSerializer ( _logger ) )
137
145
. WithThrottlingRetryOptions ( TimeSpan . FromSeconds ( configuration . RetryOptions . MaxWaitTimeInSeconds ) , configuration . RetryOptions . MaxNumberOfRetries )
138
146
. AddCustomHandlers ( requestHandlers . ToArray ( ) ) ;
You can’t perform that action at this time.
0 commit comments