Thank you for your post and I apologize for the delayed response!
I understand that your Function App is connecting to your Key Vault using a System-Assigned Managed Identity, which is working as expected but there are some performance/latency issues. To hopefully point you in the right direction or resolve your issue, I'll share my findings below.
Findings:
When it comes to the DefaultAzureCredential
side of things, it looks like this is a known bug when using DefaultAzureCredential with a Managed Identity. Based off the GitHub thread it looks like the fix is still in-progress and is actively being worked on/tracked through this issue - GitHub #29471.
From the solutions discussed throughout the GitHub issue, it looks like they all seem to point to multiple credential providers within the DefaultAzureCredential
, with the main culprit being ManagedIdentityCredential. For more info.
Since I'm not too familiar with the Azure SDK for dotnet, I'd also recommend reaching out to the experts within the Azure SDK for NET GitHub repo so they can look into your issue as well. For more info - Azure SDK for NET GitHub Issues.
Additional Links:
- GitHub Comment - Credentials causing delays
- ManagedIdentityCredential - Code used for timing
- Comment - Multiple credential providers within the DefaultAzureCredential
I hope this helps!
If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.
If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.