Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Mottor
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
v-shex-msft
Community Support
Community Support

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
If this post helps, please consider accept as solution to help other members find it more quickly.

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

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
If this post helps, please consider accept as solution to help other members find it more quickly.

@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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.