title: Spring Boot 2: Environment Variable Relaxed Binding
body: <p>I have been using environment variables to set Eureka client service url for my Spring Boot 1.5 application.</p>
  
  <pre><code>Environment=eureka_client_serviceUrl_defaultZone=http://myhost1:8761/eureka/,http://myhost2:8761/eureka/
  </code></pre>
  
  <p>However, this stopped working after upgrading to <strong>Spring Boot 2</strong>.</p>
  
  <p>I have tried other combinations but none works.</p>
  
  <pre><code>eureka_client_service_url_defaultZone
  eureka_client_service_Url_defaultZone
  EUREKA_CLIENT_SERVICEURL_defaultZone
  EUREKA_CLIENT_SERVICE_URL_defaultZone
  EUREKA_CLIENT_SERVICEURL_DEFAULTZONE
  EUREKA_CLIENT_SERVICEURL_DEFAULT_ZONE
  EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE
  EUREKA_CLIENT_SERVICE_URL_DEFAULT_ZONE
  </code></pre>
  
  <p>Does anyone know why?</p>
  
  <p>Is it because <a href="https://github.com/spring-cloud/spring-cloud-netflix/blob/master/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientConfigBean.java#L237" rel="nofollow noreferrer"><code>eureka.client.serviceUrl</code></a> is actually a <code>HashMap</code>, and the <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide#relaxed-binding" rel="nofollow noreferrer">recently tighten-up relaxed binding</a> does not work for <code>HashMap</code> with a key consisting of multiple words (i.e. <code>defaultZone</code>)?</p>