Skip to content

How to use Keycloak with SQL Server #6563

Discussion options

You must be logged in to vote

Hi, try to view my sample code

AppHost/Program.cs
var builder = DistributedApplication.CreateBuilder(args);

var passwordSql = builder.AddParameter("sqlAdminPassword", secret: true);
var db1 = builder.AddSqlServer("sql1",passwordSql).AddDatabase("db1");

builder.AddProject<Projects.DatabaseMigrations_ApiService>("api")
.WithReference(db1);

builder.AddProject<Projects.DatabaseMigrations_MigrationService>("migration")
.WithReference(db1);

var adminKeycloakUsername = builder.AddParameter("adminUsername", secret: true);
var adminKeycloakPassword = builder.AddParameter("adminPassword", secret: true);

var keycloak = builder.AddKeycloak("keycloak", adminUsername: adminKeycloakUsername, adminPasswo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by christiannagel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants