Forum Discussion

julianmbs's avatar
julianmbs
Advocate II
10 years ago

PowerBIClient.Datasets.GetGatewayDatasourcesAsync returns NULL

Hi,

 

I am trying to embed Power BI reports (using Direct Query) in my ASP.NET application, and get "Can't display the visual" message. I understand that I need to patch my data source credentials.

 

I am using this sample to provision my workspace, import reports, etc. Everything works great, except option #7 "Update connection string info for an existing dataset". Line 544 returns NULL into datasources variable, even though all three parameters are correct:

 

// Get the datasources from the dataset
var datasources = await client.Datasets.GetGatewayDatasourcesAsync(workspaceCollectionName, workspaceId, datasets.Value[datasets.Value.Count - 1].Id);

 

Any ideas what could be the problem?

 

Thanks,

Julia

7 Replies

    • julianmbs's avatar
      julianmbs
      Advocate II

      Yes, as I stated above, I am using DirectQuery mode.

      • jocaplan-MSFT's avatar
        jocaplan-MSFT
        Microsoft Employee

        And SQL Azure? Getting null there means that your dataset didn't bind to any gateway. This should only happen if you are not using one of the supported sources.