implementing Azure Key Vault access from Azure App Service using Managed Identity
I'm working on a project and hit a roadblock. I'm confused about I tried several approaches but none seem to work... I'm working with a question when trying to access secrets stored in Azure Key Vault from my Azure App Service using Managed Identity. I've set up the Managed Identity and granted it the appropriate permissions to read secrets from the Key Vault. However, I keep getting the following behavior: `"KeyVaultError: Secret not found"`. This happens when I try to retrieve the secret in my ASP.NET Core application. I've verified that the Managed Identity is enabled on my App Service and I ran the following code to access the Key Vault: ```csharp var client = new SecretClient(new Uri("https://<your-keyvault-name>.vault.azure.net/"), new DefaultAzureCredential()); var secret = await client.GetSecretAsync("<your-secret-name>"); ``` I also checked the Access Policies in the Key Vault and confirmed that the App Service's Managed Identity has the `Get` permission for secrets. I've tried redeploying the app, and even re-creating the Key Vault, but the scenario continues. I suspect it could be an scenario with how the Managed Identity is being resolved, as I don't see any other errors related to authentication. Is there something I'm missing in the configuration or the code? Any insights would be greatly appreciated! I'm working in a Windows 11 environment. Any advice would be much appreciated. This is my first time working with C# stable. This is for a microservice running on macOS. I'd be grateful for any help.