'Address already in use for concurrent getToken calls to IDENTITY_ENDPOINT on localhost /MSI/token

We have a Java/spring boot webapp deployed to an azure app service and multiple user threads are trying to concurrently access the getToken IDENTITY_ENDPOINT on localhost from a singleton service bean.

We’re seeing: java.net.BindException: Address already in use: connect

Any suggestions on how to fix this? Initial thoughts are the Java.net httpclient needs custom config or the calls could be cached?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source