There are extension tools you can use in azure ci/cd pipeline to replace the profile property value during release. Eg. RegEx Find & Replace task. See below steps:
1, Install the RegEx Find & Replace task from the market place.
2, Add RegEx Find & Replace task to the top of your pipeline. And configure it as below in dev stage:
Above configuration will match the spring.profiles.active=.*
and replace it to spring.profiles.active=dev
using RegEx in the in application.properties file.
3, In the test stage. Change the replace value to spring.profiles.active=test
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…