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
AUaero
Responsive Resident
Responsive Resident

Powershell cmdlet Get-PowerBIDatasource

Hi,

I'm trying to use Powershell to pull data lineage information from the API.  My thought was that I could enumerate the reports in a workspace, then enumerate the datasets that feed those reports, and then enumerate the data sources that feed the dataset.

My first trial run was using the get-powerbidatasource cmdlet to return the data sources associated with a given dataset. 

 

Connect-PowerBIServiceAccount
Get-PowerBIDatasource -DatasetId b4fe03be-07ca-4d4d-81d7-bc67877022d2

 

The API returns an answer, but rather than giving me all the detail about the source, the only thing it returns is DatasourceType and ConnectionDetails.  Name, ConnectionString, GatewayID, and DatasourceID are all blank. 

 

Name              : 
ConnectionString  : 
DatasourceType    : AnalysisServices
ConnectionDetails : Microsoft.PowerBI.Common.Api.Shared.DatasourceConnectionDetails
GatewayId         : 
DatasourceId      : 

 

Any ideas on what I'm doing wrong?

Thanks!

4 REPLIES 4
trebllaw
Frequent Visitor

Anyone found a solution to this? Invoking REST API calls via Powershell cmdlets is pretty slow, especially if you have thousands of datasets to query.

I'm having the same issue. Are there any resources that point to how blank results from using Power BI cmdlets in Powershell can be resolved.

AUaero
Responsive Resident
Responsive Resident

Bump - any thoughts on this?  The API call GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources returns all of the information I'm looking for in JSON format.  I'm just curious why the cmdlet doesn't return the same things as the API call?

Thanks!

Hi AUaero, did you ever find an answer to this?  I am running into the same issue.  My guess is "connectionDetails" is supposed to have that data, but I get the same results back.  

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.