Azure Functions Key Vault integration breaks with Aspire 13.2
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
Using a key vault in Azure Functions works in 13.1.2. When upgrading to 13.2.x, it fails:
```
Microsoft.Identity.Client.MsalServiceException: [Managed Identity] Error Message: Unable to load the proper Managed Identity. Managed Identity Correlation ID: [...] Use this Correlation ID for further investigation.
[...]
at Azure.Extensions.AspNetCore.Configuration.Secrets.AzureKeyVaultConfigurationProvider.Load()
[...]
at Microsoft.Extensions.Hosting.AspireKeyVaultExtensions.AddAzureKeyVaultSecrets(IConfigurationManager configurationManager, String connectionName, Action`1 configureSettings, Action`1 configureClientOptions, AzureKeyVaultConfigurationOptions options) in /_/src/Components/Aspire.Azure.Security.KeyVault/AspireKeyVaultExtensions.cs:line 177
```
### Expected Behavior
The managed identity is managed by Aspire. It should support using the key vault in Azure Functions.
Aspire has created the managed identity in Azure, and it has the correct permissions.
Aspire has configured the user assigned managed identity on Azure Functions.
### Steps To Reproduce
Probably caused by https://aspire.dev/integrations/cloud/azure/azure-default-credential/
But if this is default behavior for Azure Functions, isn't there a way to implement an automatic fix?
### Exceptions (if any)
-
### Aspire doctor output
-
### Anything else?
.NET 8
Azure Functions v4
Contributor guide
Assessment
This issue has not been assessed yet.