I am working on a containerized micro-services project (docker) in .NET Core targeting Azure. So we are using Azure Cosmos DB, and the C# Cosmos DB SDK (v2.4 since v3 is only in preview) for the CoreSql Api.
During development, I am behind a proxy, so I need to specify the proxy url for everything going outside. It works fine with HttpClientHandler for any HttpClient.
Using Cosmos DB SDK, I however don't see how to set this up on my DocumentClient.
In the Azure Node SDK, I see I could just create a ConnectionPolicy and set the ProxyUrl property for this purpose: https://docs.microsoft.com/en-us/javascript/api/%40azure/cosmos/connectionpolicy?view=azure-node-latest#proxyurl
However, in the C# variant, no ProxyUrl: https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.client.connectionpolicy?view=azure-dotnet
Is there another way to set that? It is a missing feature in Cosmos DB SDK? Thanks! Eric
You can try setting in the config file like below:
Alternatively ,you can use HttpMessageHandler class as mentioned by @Matias.