-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cosmos: Support IWebProxy configuration #19492
Comments
We should allow passing |
But it should be added through - Microsoft.EntityFrameworkCore.Cosmos provider, because we don't bother about CosmosClient object, when working with DbContext. |
Can you expose a configuration point to allow ALL CosmosClientOptions to be modified, or a least try and get a CosmosClientOptions from the DI container instead of created a new one in SingletonCosmosClientWrapper and merge your specifically configured values. Enscapulating these selected configuration concepts, one by one, in your own CosmosOptionsExtensions will mean a lot of inidividual requests. |
@slaneyrw Unfortunately no. We cache the configured services and need to calculate the cache key based on the configured values, Exposing |
Hi All, please think in the perspective of a customer company with corporate proxy, that actually blocking Cosmos DB calls, as proxy settings are not being able to inject into for local debugging purposes of the developer. Essentially it is a critical requirement for any developer. |
"Works on my machine warning..." You can do this, just need to use Reflection to set some fields on the SingletonCosmosClientWrapper singleton, before first use... I did this creating a static "patcher"the first time the DbContext is created - very fragile but works If MS simply exposed these properties on the CosmosOption option and all this goes away. `
` |
CosmoDb connection using Entity Framework Core 3.1 is not working as expected behind a Corporate Proxy environment, as it is being kicked out by Proxy as authorization required.
There is no way to override the HttpClientHandler --> to explicitly specify the proxy credentials and parameters.
This issue is highly visible in a Console application using .NET Core. Where we were trying to create a data migration component. The same issue is reproducible if you are using the Cosmos Db Data migration tool.
Steps to reproduce
1.) Create a console app behind Corp Proxy environment
2.) Set DB context and connection strings to live Cosmos Db instance in Azure
3.) In program.cs ==> Main method add this code and debug the application.
Further technical details
EF Core version: 3.1 (cosmos-netstandard-sdk/3.4.2)
Database provider: (e.g. Microsoft.EntityFrameworkCore.Cosmos)
Target framework: (e.g. .NET Core 3.1)
Operating system: Windows/10.0.17134
IDE: Visual Studio 2019 16.5 Preview 1
The text was updated successfully, but these errors were encountered: