Reputation: 924
I have an SQL Server database hosted on azure. It can access using the Azure Active Directory Service Principal. I'm trying to deploy keycloak (16.1.0) on AKS and configure the database mentioned earlier. I have an application that can connect to that SQL Server using the Azure Active Directory Service Principal. But using keycloak, it has no luck.
I have used JDBC_PARAMS="authentication=ActiveDirectoryServicePrincipal"
to configure database properties in keycloak.
Thanks
Upvotes: 1
Views: 2426
Reputation: 2764
Deploying keycloak on AKS
Please Follow this doc:
Connect to that SQL Server using the Azure Active Directory Service Principal
Active Directory Service Principal authentication mode, the client application can connect to Azure SQL data sources by providing the client ID and secret of a service principal identity. Service principal authentication involves:
Setting up an app registration with a secret.
Granting permissions to the app in the Azure SQL Database instance.
Connecting with the correct credential.
Grant access to Azure SQL Database
We need to give your application access to the Azure SQL Database service. This is done through the API Permissions.
Add client authentication
In order to authenticate Active Directory representation of it, switch over to Certificates and create a New client secret.
The following example shows how to use Active Directory Service Principal authentication
The following example shows how to use Active Directory Service Principal authentication.
// Use your own server, database, app ID, and secret.
string ConnectionString = @"Server=demo.database.windows.net; Authentication=Active Directory Service Principal; Database=testdb; User Id=App Id; Password=secret";
using (SqlConnection conn = new SqlConnection(ConnectionString)) {
conn.Open();
}
Refer this link .
Upvotes: 1