Is it possible to use AAD authenticated Azure features from Power Bi and Power Apps?

In Power Bi, we get this error when trying to make a web connection:

"We were unable to authenticate with the credentials provided. Please try again."

The Azure Feature app is registered with our AAD. The function is C # httptrigger with this code:

using System.Net;
using System.Net.Http;
using System.Security.Claims;
using System.Threading.Tasks;
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
// parse query parameter
ClaimsIdentity userClaimsId = ClaimsPrincipal.Current.Identity as ClaimsIdentity;
    var claims = userClaimsId.FindAll(ClaimTypes.Upn);
    var groups = userClaimsId.Claims.Where(x => x.Type.Equals("groups")).ToList();
    var upns = userClaimsId.Claims.ToList();
    var roles = userClaimsId.Claims.Where(x => x.Type.Equals("upn")).ToList();
    return  req.CreateResponse(HttpStatusCode.OK, groups);
}

We are trying to connect to Power Bi Desktop through the Get Data> Web option using an organizational account in our AAD. When we call a function from the browser, it requests a login and appears to return data.

enter image description here

+4
source share
1 answer

, Power BI Desktop AAD , https://yourfunction.azurewebsites.net . AAD Azure Function, - https://yourfunction.azurewebsites.net/.auth/login/aad/callback. .

, AAD Azure Function, AAD > > (. , ). OK .

enter image description here

+3

Source: https://habr.com/ru/post/1692735/


All Articles