Forum Discussion
How to connect to an Azure AD authenticated Azure Web App API
I have an Azure Web App which has a REST API. The app has Azure AD authentication included.
When I try to connect to it with Power BI using the 'Web' connector I select the 'Organization Account' login to but it tells me it couldn't authenitcate me with those credentials.
Looking through the trace logs I'm getting a 401 Unauthorised.
How can I fix this?
1 Reply
- zoloturuMemorable Member
Usually while using REST API you can't authenticate with AD in one action. Most of the times you need to register an app and then generate (refresh) a token using API call each time you use REST API.
Register an app with Azure AD (depends on which version of API you have):
* v1.0 endpoint - https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-v1-add-azure-ad-app
* v2.0 endpoint - https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-register-an-app
Regards,
Ruslan
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!