@John van Zalk welcome to the Microsoft Q&A community.
It looks like you’ve taken most of the key steps for secure access, but that error suggests there might be an issue with how the Azure Function keys are being accessed by the Logic App. Here are a few things to check:
1. Ensure the Managed Identity Has Access to Function Keys
Even though you’ve enabled a system-assigned managed identity and granted Key Vault access, the Logic App also needs permissions to retrieve the function host keys. Try assigning the "Microsoft.Web/sites/hostkeys/list/action" role to the Logic App.
2. Verify Key Vault Access for the Logic App
Make sure that the Logic App itself has permission to read secrets from Key Vault and that the correct authentication method is being used in the Logic App’s settings.
3. Check Azure Function Authentication Settings
If you’ve enabled authentication on your Function App, ensure that it allows managed identity-based authentication for the Logic App. Otherwise, the request might fail due to security restrictions.
- Manually Retrieve the Key from Key Vault in the Function App
Instead of relying on automatic key retrieval, you can test this manually by:
Making an HTTP request within your Function App to Azure Key Vault using its system-assigned identity.
Using Azure SDKs or REST APIs to fetch the secret and confirming it works independently of the Logic App.
5. Check the Function App Logs for More Details
Navigate to your Function App’s Application Insights logs or Monitor tab in Azure and see if there are any additional details about the internal server error.
6. Try Using an Azure Key Vault Reference Instead
Instead of using direct API calls, Azure Functions supports Key Vault references in application settings, allowing secrets to be retrieved securely at runtime.
Give these a try, and let me know what happens—sometimes the fix is hidden in a small overlooked permission setting.
I hope these helps. Let me know if you have any further questions or need additional assistance.
Also if these answers your query, do click the "Upvote" and click "Accept the answer" of which might be beneficial to other community members reading this thread.