Keycloak not booting on Azure container apps

165 Views Asked by At

I am trying to boot Keycloak with start-dev on an azure container apps, and it's not working.

My configuration is the following :

aca config

I have no application logs in ContainerAppConsoleLogs_CL

I only have the following system logs : Container 'key' was terminated with exit code '' and reason 'ContainerCreateFailure'

error log

I tried with a previous version of key cloak: 16.0 seems to work, but not the latest (24)

Do you any insight on how I can debug further?

2

There are 2 best solutions below

0
Mar8x On BEST ANSWER

I had same issue with v24.0.1. Once I changed the command to: /opt/keycloak/bin/kc.sh, start-dev

The path of kc.sh is the same as found in the Entrypoint in the image. The comma is required to separate between argument and command (as I followed the help text in the form field).

0
Arko On

To setup keycloak on ACI using image stored in ACR you can follow below steps-

Create an ACR if you don't have one:

az acr create --resource-group myResourceGroup --name myRegistry --sku Basic

once active enable admin login from portal in your acr or using CLI

az acr update --name myRegistry --admin-enabled true

login to acr

az acr login --name myRegistry

Push the Keycloak image to ACR I am using jboss image

docker pull jboss/keycloak![enter image description here](https://i.imgur.com/SoDPlaT.png)
docker tag jboss/keycloak myRegistry.azurecr.io/keycloak
docker push myRegistry.azurecr.io/keycloak

Create a Container App

  • Go to the Azure portal, and create a new Container App.
  • Select the appropriate subscription, resource group, and region.
  • Choose the ACR as the source for your container images.
  • Select the myRegistry.azurecr.io/keycloak image you pushed earlier.
  • Set up the required environment variables for Keycloak, such as KEYCLOAK_USER and KEYCLOAK_PASSWORD while setup. Configure the CPU, memory, and other network setting and deploy enter image description here

Once deployed, you can verify the same using the app url

enter image description here

Other alternative methods- Using azure webapp

Here , I am using the same jboss/keycloak image in my acr and create the webapp. When setting up, select docker container enter image description here

and under docker tab choose your acr where you kept the keycloak image

enter image description here

enter image description here

You don't have to put any startup command. Choose your type of networking and deploy

enter image description here

and similar way you can access your keycloak using the app url enter image description here

Alternatively if you use quay keycloak, as suggested by Marc Schneider, while setup under command section, you can use command: /opt/keycloak/bin/kc.sh, start-dev and it should boot up also I added the keycloak credentials as environmental variable

KEYCLOAK_USER = admin KEYCLOAK_PASSWORD = Password

and was successfully able to deploy keycloak on azure container apps

enter image description here

enter image description here

Reference: Keycloak on keycloak on webapp