CosmosClientOptions.HttpClientFactory Property

Definition

Gets or sets a delegate to use to obtain an HttpClient instance to be used for HTTPS communication.

[Newtonsoft.Json.JsonIgnore]
public Func<System.Net.Http.HttpClient> HttpClientFactory { get; set; }
[<Newtonsoft.Json.JsonIgnore>]
member this.HttpClientFactory : Func<System.Net.Http.HttpClient> with get, set
Public Property HttpClientFactory As Func(Of HttpClient)

Property Value

Func<HttpClient>
Attributes
Newtonsoft.Json.JsonIgnoreAttribute

Remarks

HTTPS communication is used when ConnectionMode is set to Gateway for all operations and when ConnectionMode is Direct (default) for metadata operations.

Useful in scenarios where the application is using a pool of HttpClient instances to be shared, like ASP.NET Core applications with IHttpClientFactory or Blazor WebAssembly applications.

For .NET core applications the default GatewayConnectionLimit will be ignored. It must be set on the HttpClientHandler.MaxConnectionsPerServer to limit the number of connections

Applies to