I have a Linux VM hosted on Azure. On this VM I "installed" the standalone version of Keycloak 19.0.2. When I connect to the VM with SSH, I can simply start the server with bin/kc.sh start-dev. This works without any problems.
Now I want to start the Keycloak server automatically on the VM startup. I tried this with Crontab. This did not work because the VM resets the Crontab on each restart.
Then I tried to directly start it from Azure with a Custom Script for Linux. Since I had trouble setting it up, I started playing around with the Run command feature in the Azure portal. When I run the command sudo /home/my_user/keycloak/bin/kc.sh start-dev I get the following output:
2022-09-14 14:19:32,839 INFO [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: FrontEnd: <request>, Strict HTTPS: false, Path: <request>, Strict BackChannel: false, Admin: <request>, Port: -1, Proxied: false
2022-09-14 14:19:34,670 INFO [org.keycloak.common.crypto.CryptoIntegration] (main) Detected crypto provider: org.keycloak.crypto.def.DefaultCryptoProvider
2022-09-14 14:19:36,475 WARN [org.infinispan.CONFIG] (keycloak-cache-init) ISPN000569: Unable to persist Infinispan internal caches as no global state enabled
2022-09-14 14:19:36,483 WARN [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
2022-09-14 14:19:36,553 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
2022-09-14 14:19:37,251 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000128: Infinispan version: Infinispan 'Triskaidekaphobia' 13.0.9.Final
2022-09-14 14:19:37,886 INFO [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: node_884187, Site name: null
2022-09-14 14:19:41,657 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (development) mode
2022-09-14 14:19:41,657 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Unable to start HTTP server
2022-09-14 14:19:41,658 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: io.quarkus.runtime.QuarkusBindException
2022-09-14 14:19:41,658 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.
TLDR: The server starts perfectly fine, when I manually start it via SSH. When I try to start the server with the Azure portal (Run command) it does not work.