Hi, having trouble getting an azure webapp with Keycloak docker image running with pgsql backend. Running fine without pgsql backend, but fails when trying to configure this. Anyone able to tell me what I am doing wrong?
Deploying with terraform and these environmental variables/app settings for pgsql:
KC_DB = "postgres"
KC_DB_URL_DATABASE = "keycloak"
KC_DB_URL_HOST = "mypgsql.postgres.database.azure.com"
KC_DB_URL_PORT = 5432
KC_DB_URL_PROPERTIES = "?sslmode=require" (tried with and without this setting)
KC_DB_SCHEMA = "public"
KC_DB_USERNAME = "user"
KC_DB_PASSWORD = "pass"
KC_TRANSACTION_XA_ENABLED = false (tried with and without this setting)
Error I am getting is:
ERROR: URL format error; must be “jdbc:h2:{ {.|mem:}[name] | [file:]fileName | {tcp|ssl}:[//]server[:port][,server2[:port]]/name }[;key=value…]” but is “jdbc:postgresql://mypgsql.postgres.database.azure.com:5432/keycloak” [90046-214]
Thank you for replying, I am really stuck here so I appreciate all help I can get. Have not had time to test your suggestion yet, but I am not sure if this is really the problem.
When I try running keycloak in docker locally on my own PC towards the azure postgres server it works fine, creating tables in postgres. But not when running docker image from a azure web app. I have set the postgres server to accept all connections coming from azure environment, but still no luck.
I finally found out how to solve it. I found and used the same connectionstring generated in the keycloak docker running locally using azure pgsql as backend. Using the same constring worked perfect when deploying azure web app with terraform.
Could anyone please post the ms sql equivalent connectionstring for me?
I still have not managed to get it to run against ms sql, so if you have; can you please check in
/admin/master/console/#/master/providers
and under “connectionsJpa” you will find the connectionstring. If anyone can give me a clue to how this one looks like, it will be greatly appreciated.