title: Spring Cloud Vault Profile Specific Bootstrap
body: <p>I have a Spring Boot Application and I would like to Load configurations from Vault based on the Profile I am running. At present i have 2 profiles (dev, prod). My Dev Profile uses a H2 database where as the Prod Profile uses a Posgres DB. Running the dev Profile loads the correct config from Vault but running with the Prod Profile seems to be skipping it somehow and not looking in Vault. </p>
  
  <p><strong>bootstrap.yaml</strong></p>
  
  <pre><code>spring:
    application:
      name: my-app
    profiles:
      active:
    cloud:
      vault:
        host: localhost
        port: 8200
        scheme: http
        uri: http://localhost:8200
        connection-timeout: 5000
        read-timeout: 15000
        authentication: TOKEN
        token: 00000000-0000-0000-0000-000000000000
        kv:
          enabled: true
          backend: secret
          default-context: my-app/dev
        fail-fast: false
  </code></pre>
  
  <p><strong>bootstrap-prod.yaml</strong></p>
  
  <pre><code>spring:
    application:
      name: gateway
    profiles:
      active: prod
    cloud:
      vault:
        host: localhost
        port: 8200
        scheme: http
        uri: http://localhost:8200
        connection-timeout: 5000
        read-timeout: 15000
        authentication: TOKEN
        token: 00000000-0000-0000-0000-000000000000
        kv:
          enabled: true
          backend: secret
          default-context: my-app/dev
        fail-fast: false
  </code></pre>
  
  <p>For example running the command <code>gradle</code> will load configuration from vault. But running <code>gradle -Pprod</code> fails to load the correct configuration from Vault.</p>