title: Use SpringBoot SpEL in YAML
body: <p>Is it possible in spring boot yaml configuration to use SpEL to call static method functions? I'm wanting to find an available port between a port range and set the server port. I know this can be done programmatically but am curious if this can be done just in YAML with SpEL. I've tried the following which does not work as it sees the SpEL as a YAML comment</p>
  <pre><code>server:
      port: #{T(org.springframework.util.SocketUtils).findAvailableTcpPort(8000,9000)}
  </code></pre>
  <p>This one fails as it tries to set the SpEL as a string to the port</p>
  <pre><code>server:
      port: &quot;#{T(org.springframework.util.SocketUtils).findAvailableTcpPort(8000,9000)}&quot;
  </code></pre>