cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mottor Frequent Visitor
Frequent Visitor

AADSTS50001 error on Web API with Azure AD

Hi,

 

I have a Web API services on company server, which use Azure Active Directory for authentication.

Now I want to connect to these services from Power BI Desktop. (New source -> Web -> From Web -> Organizational account

And when I try to "Sign in",  I am getting:

"invalid_resource: AADSTS50001: The application named <WEB SERVICES DOMAIN> was not found in the tenant named <MY TENANT>. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant."
Where can I set the client id? And why is the application searched the first part of the address (https://subdomain.domain.com)?

 

Best Regards

4 REPLIES 4
Community Support Team
Community Support Team

Re: AADSTS50001 error on Web API with Azure AD

Hi @Mottor,

 

I try to connect the url which you provided, then I got a "404 Not Found" error.

 

"invalid_resource: AADSTS50001: The application named <WEB SERVICES DOMAIN> was not found in the tenant named <MY TENANT>. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant."

 

Based on my test and your error message, I think the issue may related to custom domain setting. Can you ensure you have configured correctly?

 

For detail information, you can refer to below article:

Configuring a custom domain name for an Azure cloud service

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
Mottor Frequent Visitor
Frequent Visitor

Re: AADSTS50001 error on Web API with Azure AD

Hi @v-shex-msft,

 

    I will try to explain. I have a web service on a serve inside our company. Let say its (fictive) address is https://mycompany.com/mywebservice.  Then I have registration in Azure Active Directory (portal.azure.com). From Azure I've got an Instance ('https://login.microsoftonline.com/') a Tenant (micompanygmbh.onmicrosoft.com) and a ClientId ( '12345abc-678d-9012-3456-fgh789ijkl01'), which I use (config) to connect from JavaScript, I use adal.js for authentication ( authContext = new AuthenticationContext(config);) and to get token ( authContext.acquireToken(authContext.config.clientId, function (error, token) {..});) and make request to web service. The web service use BearerTockenAuthentication.

   Now, Iwant to connect to this service from Power BI Desktop? I have to send the ClientId. Without it there is no access. That means I have to change the header. What should I do (use)?

 

Best Regards

Community Support Team
Community Support Team

Re: AADSTS50001 error on Web API with Azure AD

Hi @Mottor,

 

I find a sample about use power query to call the azure api(not azure ad), perhaps you can reference to below code:

 

let
    AzureMLJsonToTable = (
        WebServiceURI as text,
        WebServiceKey as text,
        TableToScore as table,
        optional Timeout as number
    ) as any => 
let
    WebTimeout = if Timeout = null then #duration(0,0,0,100) else #duration(0,0,0,Timeout) ,  

    WebServiceContent = ToAzureMLJson(TableToScore),//method which used to convert the table to json

    //example:
    WebServiceURI1 = "https://europewest.services.azureml.net/workspaces/dcfeb7f96e2d431cb836299c27661e1e/services/d6291034e7c44b3ab63f0b26772a583b/execute?api-version=2.0&details=true",
    WebServiceKey1 = "Pxy+NXyx/YZA/YkD0OENmG4awDZGpLeHGFKKf5XgC6sKgJPPO/CUp4tin15N8aMWgpKbu41Nv9/ruWW2rIKUHA==",

    WebResponse = Web.Contents(WebServiceURI,
        [Content = Text.ToBinary(WebServiceContent),
         Headers = [Authorization="Bearer " & WebServiceKey,
                    #"Content-Type"="application/json",
                    Accept="application/json"],
         Timeout = WebTimeout]),
    
    output = AzureMLJsonToTable(WebResponse) // method which used to convert json to table
in
    output 

in
    AzureMLJsonToTable

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
lars_k Frequent Visitor
Frequent Visitor

Re: AADSTS50001 error on Web API with Azure AD

@v-shex-msft That response does not help at all. I'm having this same problem, using PowerQuery for Excel. There's a "hidden" application involved (see here: https://stackoverflow.com/a/42513455/287610) and apparently the user needs to grant consent to that. I would like to know if there's a workaround so that Excel properly authenticates with my client ID to begin with.

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors