-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
We observe the following error log in our system:
"Azure Identity => ERROR in getToken() call for scopes [https://ossrdbms-aad.database.windows.net/.default]: Managed Identity authentication failed, see inner exception for more information.", logged by "com.azure.identity.ManagedIdentityCredential".
This issue is not about the error itself, but about the logging of the error such that we can obtain more information for further analysis. The error log references an "inner exception" we cannot see because no stack trace is logged.
To Reproduce
Create a setup such that an error occurs in the getToken() call for scopes; with the available source code that could also be done via unit tests / mocking. See also Additional Context.
Expected behavior
The log entry contains a stack trace with an inner exception.
Setup (please complete the following information):
- OS: Linux Container (Ubuntu)
- IDE: IntelliJ
- Library/Libraries: com.azure:azure-identity:1.17.0 (current version should also be affected)
- Java version: 21
- App Server/Environment: Azure Container Apps
- Frameworks: Spring Boot
Additional context
I looked at the source code and assume the problem is in the logTokenError method of the LoggingUtil class (called by ManagedIdentityCredential as error handling). This method accepts a Throwable error, but logs only its message.
The above mentioned exception "Managed identity authentication failed, see inner exception" is created by the IdentityClientclass.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [ x ] Bug Description Added
- [ x ] Repro Steps Added
- [ x ] Setup information Added
Metadata
Metadata
Assignees
Labels
Type
Projects
Status