Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Custom connector on Power BI service Error

Hi,

I created a custom connector to access my organization AAD.
I added to the PBI desktop and it is working fine . when I published it to the PBI service I got the following error when try to refresh dataset .

The import Azure_Active_Directory matches no exports. Did you miss a module reference?

any ide what causes this issue 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Do you have successfully configured the credentials or gateway for your data source?

    Data refresh in Power BI - Power BI | Microsoft Learn

    Add or remove a gateway data source - Power BI | Microsoft Learn

    Has the refresh been successful? Whether it was intermittent failure or never succeeded.

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 
    Hi Stephen,
    I am using AAD so I don't think I need to the gateway because I am not using any onpremises datasource

    my custom connector code is the following

    UserData=(Azure_AD_Tenant_ID as text,Azure_Application_Client_ID as text, Azure_Application_Client_Secret as text) =>
         let      token_uri = "https://login.microsoftonline.com/" & Azure_AD_Tenant_ID & "/oauth2/token",
        resource="https://graph.microsoft.com", 
       
    tokenResponse = Json.Document(Web.Contents(token_uri,
        [
            Content = Text.ToBinary(Uri.BuildQueryString(
                [
                    client_id = Azure_Application_Client_ID,
                    resource = resource,
                    grant_type = "client_credentials",
                    client_secret = Azure_Application_Client_Secret
                ]
            )),
            Headers = [Accept = "application/json"], ManualStatusHandling = {400}
        ])),
        access_token = tokenResponse[access_token],
        Source = OData.Feed("https://graph.microsoft.com/beta/users?$top=999&$select=id, companyName, department&$filter= accountEnabled eq true", [ Authorization = "Bearer " & access_token ], [ ExcludedFromCacheKey = {"Authorization"},ODataVersion=4, Implementation="2.0"])
    in    Source;

    When I investigate I got that error is that it is an unsupported datasource.
    when I use direct query it is working and asked me for credentials