With Keycloak installation 9.0.2.
From keycloak documentation a SPI and provider can be configured the following way within a CLI script:
**/spi=dblock/:add(default-provider=jpa)
**/spi=dblock/provider=jpa/:add(properties={lockWaitTimeout => "900" },enabled=true)
With the goal of settings the properties and enabling the provider using environment properties I have done in my script the following (adapting from the public documentation case):
**/spi=dblock/:add(default-provider=jpa)
**/spi=dblock/provider=jpa/:add(properties={lockWaitTimeout => "${env.LOCK_WAIT_TIMEOUT:900}" },enabled="${env.ENABLE_JPA:true}")
Running my server in standalone mode it leads to the following configuration in my standalone.xml file:
...
<spi name="dblock">
<provider name="jpa" enabled="false">
<properties>
<property name="lockWaitTimeout" value="${env.LOCK_WAIT_TIMEOUT:900}"/>
</properties>
</provider>
</spi>
...
Properties are evaluated correctly with environment variable, but setting the enabled value as described above will always result to it statically being evaluated to false.
Is it not possible to use environment variable at this level and have anyone an idea how I should do so ? Thanks a lot for your time.