Intermittent ManagedIdentityCredential authentication failure
See original GitHub issue- Package Name: @azure/identity
- Package Version: 1.2.3
- Package Name: @azure/service-bus
- Package Version: 7.0.3
- Operating system: Ubuntu 20.04.2. LTS
- nodejs
- version: v12.18.2
- typescript
- version: 4.1.5
Describe the bug
(I do not know that this is an actual bug.) I frequently see ‘ManagedIdentityCredential authentication failures’ when using DefaultAzureCredential
on my laptop. This behavior is highly intermittent and I don’t know how to debug it.
To Reproduce Steps to reproduce the behavior:
- Login with
az login
. - Use
DefaultAzureCredential
to try to establish an Azure auth identity. - Use this identity credential to establish a ServiceBusClient and a ServiceBusReceiver. Then do a subscribe on this receiver.
- Then, maybe half of the time, I get the following error:
ManagedIdentityCredential authentication failed.(status code undefined).
More details:
request to http://169.254.169.254/metadata/identity/oauth2/token?resource=https%3A%2F%2Fvault.azure.net&api-version=2018-02-01 failed, reason: connect EHOSTUNREACH 169.254.169.254:80
Comments
- I don’t know why it’s trying to connect to
http://169.254.169.254
from my laptop! - I don’t know why this is intermittent. If I run the same code multiple times, I can’t determine a pattern or factor why it fails or succeeds.
- I don’t know how to get any more debugging information than the error message from above.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
AAD Pod-identity intermittent issues with applications #1287
error in obtaining secret: ManagedIdentityCredential authentication failed. Status code: 500. More details: unknown_error Status code: 500
Read more >ManagedIdentityCredential authentication unavailable. No ...
This is a problem with the Azure VM, or an issue with Microsoft.Data.SqlClient. ManagedIdentityCredential authentication unavailable.
Read more >ManagedIdentityCredential authentication unavailable, no ...
Trying to connect Azure key vault using batch pool . It was successful using service principle , but when using managed identity its...
Read more >Target Credential Issues by Authentication Protocol - Reddit
I keep receiving: Target Credential Issues by Authentication Protocol - Intermittent Authentication Failure.
Read more >spring boot security login error 400, using Guava Optional ...
Azure - Accessing Key Vault using User Managed Identity in Java Spring Boot : Error Details: ManagedIdentityCredential authentication unavailable? Error ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @sadasant. I finally got around to testing this issue today (testing with the alpha release package you mentioned earlier). It appeared to completely address the issue! Thanks so much for your help with this!
I’ll upgrade to
1.2.4
now!Hi @sadasant. Your reply responsiveness is AMAZING!
I am definitely willing to try the alpha package tomorrow. However, I’m not sure I can confirm if the alpha package fixes anything because my underlying issue with
DefaultAzureCredential
(ManagedIdentityCredential
network failure) is intermittent – because I don’t really know what’s causing it, I don’t really know if the alpha package fixes it. The problem goes from happening almost every time I try to useDefaultAzureCredential
to not appearing for a couple of days.Yes, I think I have only hit this problem locally on my dev machine.
DefaultAzureCredential
seems to be working fine in our Azure App Services.