In encountered a startup issue in my Azure Function, but was lacking error details to properly troubleshoot it. Luckily I found a feature in Azure that can help you diagnose startup issues.
In my case I encountered a KeyVault access issue. Since I was integrating with multiple KeyVaults in my function, it was a bit tricky to troubleshoot. The error message:
Microsoft.Azure.KeyVault: Operation returned an invalid status code ‘Forbidden’.
To get more details on the actual error, do the following:
- Go to the Azure Portal
- Navigate to your Azure Function
- Select Diagnose and solve problems in the menu.
- Select Function App Down or Reporting Errors
- It will now do some analyses and provide you with the errors it encountered.
- You might have to click Go to detector.
In my case it showed me an exception like this, which got me on the right track to find what permissions I forgot to set.
Hope this helps and good luck troubleshooting!