How can I use the logback.xml stored in the Azure Spring Cloud Config Server?

Rodolfo Vasconcelos 21 Reputation points
2020-10-19T20:50:14.243+00:00

Hi,

I want to store the logback.xml in the Azure Spring Cloud Config Server.

I have set up a repo with the application.properties and the logback.xml.

All the properties in the application.properties can be fetched, but the property logging.config gets a 401 Unauthorized.

This is how the property is set in the application.properties:

logging.config=${spring.cloud.config.uri}/application/default/master/logback.xml

This is the error:

"10/19/2020, 3:26:58.455 PM","{""@timestamp"":""2020-10-19T15:26:58.454Z"",""@version"":""1"","

"message"":""Error opening logging config file https://myapp.svc.azuremicroservices.io/config/application/default/master/logback.xml"",""logger_name"":""org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration"",""thread_name"":""main"",""level"":""WARN"",""level_value"":30000,""stack_trace"":""java.io.IOException:
Server returned HTTP response code: 401 for URL:
https://myapp.svc.azuremicroservices.io/config/application/default/master/logback.xml\\n\\tat
sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)\n\tat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)\n\tat sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)\n\tat java.net.URL.openStream(URL.java:1068)\n\tat org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.reinitializeLoggingSystem(PropertySourceBootstrapConfiguration.java:143)\n\tat org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:126)\n\tat org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:626)\n\tat org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:370)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:314)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)\n\tat com.ethoca.eliminatorissuerapi.EliminatorIssuerApiApplication.main(EliminatorIssuerApiApplication.java:27)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)\n\tat org.springframework.boot.loader.Launcher.launch(Launcher.java:107)\n\tat org.springframework.boot.loader.Launcher.launch(Launcher.java:58)\n\tat org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)\n"",""projName"":""[MYAPP]""}

My understanding is that I should supply the credentials, but how?
Where I can see the credentials defined in the Azure Config Server?

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.
124 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.