We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The docs say that you should be able to do this, which is ideal for using PostgreSQL (EF Core) with managed identities:
builder.AddNpgsqlDbContext<YourDbContext>( "postgresdb", configureDataSourceBuilder: (dataSourceBuilder) => { if (!string.IsNullOrEmpty(dataSourceBuilder.ConnectionStringBuilder.Password)) { return; } dataSourceBuilder.UsePeriodicPasswordProvider(async (_, ct) => { var credentials = new DefaultAzureCredential(); var token = await credentials.GetTokenAsync( new TokenRequestContext([ "https://ossrdbms-aad.database.windows.net/.default" ]), ct); return token.Token; }, TimeSpan.FromHours(24), TimeSpan.FromSeconds(10)); });
But the configureDataSourceBuilder parameter is just not there.
Where is that parameter and how do we use managed identities with PostgreSQL when using EF Core?
You should be able to do this:
No response
.NET SDK: Version: 8.0.406 Commit: 73c77e847d Workload version: 8.0.400-manifests.f7661779 MSBuild version: 17.11.22+17752cebd
Runtime Environment: OS Name: Windows OS Version: 10.0.26100 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.406\
.NET workloads installed: Configured to use loose manifests when installing new manifests. There are no installed workloads to display.
Host: Version: 8.0.13 Architecture: x64 Commit: eba546b0f0
.NET SDKs installed: 8.0.406 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found: None
Environment variables: Not set
global.json file: Not found
.NET Aspire Version: 9.0 Aspire.Npgsql.EntityFrameworkCore.PostgreSQL version: 9.0.0 IDE: VS Code
The text was updated successfully, but these errors were encountered:
The docs were broken. We've fixed them with Update Azure Postgres code (dotnet/docs-aspire#2778) which is live now on https://learn.microsoft.com/dotnet/aspire/database/azure-postgresql-entity-framework-integration?tabs=dotnet-cli#add-azure-authenticated-npgsql-client.
Sorry, something went wrong.
No branches or pull requests
Is there an existing issue for this?
Describe the bug
The docs say that you should be able to do this, which is ideal for using PostgreSQL (EF Core) with managed identities:
But the configureDataSourceBuilder parameter is just not there.
Where is that parameter and how do we use managed identities with PostgreSQL when using EF Core?
Expected Behavior
You should be able to do this:
Steps To Reproduce
Exceptions (if any)
No response
.NET Version info
.NET SDK:
Version: 8.0.406
Commit: 73c77e847d
Workload version: 8.0.400-manifests.f7661779
MSBuild version: 17.11.22+17752cebd
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.406\
.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.
Host:
Version: 8.0.13
Architecture: x64
Commit: eba546b0f0
.NET SDKs installed:
8.0.406 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Anything else?
.NET Aspire Version: 9.0
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL version: 9.0.0
IDE: VS Code
The text was updated successfully, but these errors were encountered: