If it was an authentication error, I would imagine you would get an error response rather than an empty json array. One thing I can suggest doing is using the api-version
value that's being used in the Try it experience on the documentation. Or you could run a F12 Network browser trace, looking for this API call from the portal and using that same api-version
value. I would also check the Bearer
token your app service is using to check for any inconsistencies in the claims.
---
EDIT 2022 Aug 23 I've received further clarification on this matter. The reason why you're getting an empty result is because you've added permissions to billing subscriptions tied to a subscription but not access to billing accounts which is not scoped at the subscription level. I'm assuming followed this doc for guidance. See Billing accounts and scopes in the Azure portal, if you haven't already, to get a better understanding how billing accounts are structured.
Try elevating access for your service principal to return the billing account information.