-
Notifications
You must be signed in to change notification settings - Fork 140
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
Update Azure Postgres code #2778
Conversation
The EntityFramwork code to talk to Azure Postgres is incorrect. It needs to be different depending on the version of EF being used. Fix #2769
Co-authored-by: David Pine <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks.
Just to make sure - the switch from UsePeriodicPasswordProvider to UsePasswordProvider is in principle good, but can you confirm whether credentials.GetTokenAsync()
internally caches the token? If not, that's a new token for each physical connection, which might be a bit much. The lambdas passed to UsePasswordProvider could implement caching to mitigate that if we think that's important.
I don't believe it caches itself. At least I haven't seen any code that does this.
This would be too much code / implementation for sample/doc code. Instead it would be a great thing for a specific package to deal with Entra ID + Npgsql. |
I guess I agree... It's unfortunate for our basic sample to show something inefficient, but hopefully we'll have a package soon. FWIW the performance of opening a new physical connection (as opposed to getting a pooled one) isn't that critical. |
@roji are you working on a package that can switch between normal Postgres and azure? That’s what we need to do to take away all of the pain here and what aspire intends to do if there’s no other alternative |
@davidfowl I agree - this is something that I raised internally with the Azure folk themselves; I believe there should be an Azure.Npgsql package, and that they should ideally own it. I'll forward you the email thread in case you're interested etc. |
(oh I see you already got looped in) |
The EntityFramwork code to talk to Azure Postgres is incorrect. It needs to be different depending on the version of EF being used.
Fix #2769