
Hi Thibault,
I guess your setup won’t work since Azure Webapps don’t allow any communication between Webapp instances.
The S3 storage is just used so the instances discover their IP addresses but they cannot use them to connect. That’s why people rather use something like Azure Kubernetes Service to run Keycloak in HA mode.
Best regards,
Sebastian
Mit freundlichen Grüßen / Best regards
Dr.-Ing. Sebastian Schuster
Product Area User Management (BD/PAU1)
Bosch.IO GmbH | Ullsteinstr. 128 | 12109 Berlin | GERMANY | www.bosch.io
Tel. +49 30 726112-485 | Mobil +49 152 02177668 | Telefax +49 30 726112-100 | Sebastian...@bosch.io
Sitz: Berlin, Registergericht: Amtsgericht Charlottenburg; HRB 148411 B
Aufsichtsratsvorsitzender: Stefan Koss; Geschäftsführung: Dr. Andreas Nauerz, Stephan Lampel
From: keyclo...@googlegroups.com <keyclo...@googlegroups.com> on behalf of Thibault Miclo <miclo.t...@gmail.com>
Date: Wednesday, 26. April 2023 at 13:04
To: Keycloak User <keyclo...@googlegroups.com>
Subject: [keycloak-user] Distributed Caching is not working with Azure
Hi,
I have setup Keycloak 21.1 in Azure as a Webapp running in a docker container. All runs fine with 1 instance. As soon as I add a second instance, login goes into a redirect loop due to not finding my session (which I strongly suspect is related to the distributed caching as I have hit that issue in a local test environment before).
I can confirm the docker container is built with the correct cache and connecting properly to the Azure storage container as I can see files there:

My current containers run with
ENV JAVA_OPTS_APPEND="-Djboss.jgroups.azure_ping.storage_account_name=myaccount -Djboss.jgroups.azure_ping.storage_access_key=mykey -Djboss.jgroups.azure_ping.container=containername -Djava.net.preferIPv4Stack=true
I have tried to go through logs to find a solution but the only relevant logs I could find where something like
[org.keycloak.models.sessions.infinispan.changes.sessions.PersisterLastSessionRefreshStore] (Timer-0) Updating 0 userSessions with lastSessionRefresh: 1682502329
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups "Keycloak User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
keycloak-use...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/keycloak-user/ebc877e6-1f2b-4077-bde2-d568eba06c82n%40googlegroups.com.