Changes to application yml for using different profiles in spring boot cloud config

Viewed 190

I am having trouble connecting to different profiles in spring boot version 2.5.6 using spring cloud config. I am trying to retrieve the properties through label. When I give the lable directly, it works. But when I am adding profiles I get the error - If you have database settings loaded from a particular profile you may need to activate it(no profiles are currently active)

I have followed the approach mentioned in What are the proper changes for spring-cloud-config on Spring Boot 2.4.x?, still getting this error

My application yml looks something like

(...)

spring:
  application:
    name: my_app
  cloud:
    config:
      label: develop
      uri: ssh://git@bitbucket....
      enabled: true
---
spring:
  config:
    activate:
      on-profile: int
  cloud:
    config:
      label: develop
      uri: ssh://git@bitbucket....
      enabled: true
---
0 Answers
Related