I am trying to configure the security for a Logic App and Azure Function. The Azure Function has an HTTP Trigger. So far I have done the following:
- Created the Azure Function with some basic functionality (write query in request to log).
- Created the Logic App (recurrence trigger, HTTP to trigger the Azure Function)
- Tested that the Logic App successfully calls the Azure Function
- Added a managed identity to the Logic App
- Enabled Azure AD Authentication/Authorisation on the Azure Function App and used the express configuration which created the App Registration in Azure AD for the Function App.
- Added Managed Identity as the Authentication method in the HTTP action within the Logic App.
When I run the Logic App it shows that the HTTP action fails because it's unauthorized. Can anyone tell me what I'm missing? I've found a few tutorials on how to access a KeyVault (for example) using a similar approach, but nothing for an Azure Function. I feel like I need to tell the App Registration that the Managed Identity for the Logic App has permissions, but I don't know if this is correct, nor how to do it.