-
Notifications
You must be signed in to change notification settings - Fork 206
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
Managing the HttpClient for Cosmos #724
Comments
cc @ealsur , Do you have any insights here, is this supported. |
No, this is not possible, the internal HttpClient or configuration is not accessible. |
Thanks both,. The question isn't whether it's possible though, it's whether you'd accept a PR that makes it possible. There are some options in the ticket that would make it accessible using the HttpClientFactory approach that the underlying Cosmos SDK providers (which the webjobs ask is hiding right now) |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
I'm attempting to get CosmosDbTriggers working against the cosmos emulator. Specifically, this is a problem when the emulator runs with a different hostname (i.e. part of a docker-compose).
This details how to do disable SSL validation, however, this isn't an access level we have in the CosmosDbTrigger attribute.
https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator?tabs=cli%2Cssl-netstd20#disable-ssl-validation
I can see 4 distinct ways that this could be fixed, and I'm happy to do the work if you're happy to accept the changes.
Option 1: Parameter on the Attribute for Disabling SSL Validation
Provide a bool on the attribute properties that will generate a DocumentClient with SSL validation disabled (overriding the handlers).
Option 2: Unseal/make public the
ICosmosDbService
interfacesIf these were opened up, we could inject our own at startup.
Option 3: Make the trigger support
This would be then specifically optimised to use against the emulator. This is potentially more work to maintain, but encapulat
Option 4: Make the DocumentClient get it's HttpClient from the services HttpClientFactory
If this uses a named httpclient from the HttpClientFactory, then we can override this in the Client factory to return one that bypasses the SSL validation. This is potentially dangerous as "Global" HttpClient changes could inadvertently affect the Trigger client without intending to.
My preference is Option 2 as it's obscure enough that it wouldn't be used by everyone as a simple property change, but powerful enough to give us an extension point for testing. It doesn't tie anything to the emulator scenario and introduces other interesting scenarios I think.
What I need to know is, would that be accepted by the maintainers? I have noticed that there's an upgrade to the V3 SDK in there, so maybe it's a fast follower after that?
The text was updated successfully, but these errors were encountered: