azure spring cloud want to use /myappname/config.message instead of default /application/config.message

anil 21 Reputation points
2022-09-02T18:41:46.827+00:00

I am following this tutorial to setup spring azure config
https://learn.microsoft.com/en-us/azure/azure-app-configuration/enable-dynamic-configuration-java-spring-app

at step 7 is there anyway I could use custom key instead of /application/config.message I want to use /myappname/config.message instead of default

Azure Spring Apps
Azure Spring Apps
An Azure platform as a service for running Spring Boot applications at cloud scale. Previously known as Azure Spring Cloud.
109 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,141 Reputation points
    2022-09-08T18:50:42.567+00:00

    @anil Thank you for reaching out to Microsoft Q&A. Sorry for the delay in response.

    Yes, you can use a custom key instead of default "/application/config.message" showed in the example. Check Spring Cloud for Azure starter App Configuration that has property spring.cloud.azure.appconfiguration.stores[0].selects[0].key-filter with default "/application/*". You can make it either "/myappname/" or "/${spring.application.name}/" based on your need.

    239148-image.png

    The key-filter value is a prefix added onto the keys and is trimmed from the keys in use (same is described here and check out for all of the details on how the Spring Cloud Azure App Configuration library works). I hope this answers your question and feel free to add if you have any questions. I would be happy to assist you.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community.

    1 person found this answer helpful.