If you are talking about running the MyApplication under yaml directory, you need to specify an active profile.
In IntelliJ, click "Run" , select "edit configuration". In the VM options, put -Dspring.profiles.active=prod .
Then, you will be able to load the properties from the application.yml.
We find this kind of rampant individuality very disturbing. But not this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!