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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
powerbi_jenhen
Resolver II
Resolver II

API to return deployment pipeline dev stage workspace names

Hi,

 

I need to return all dev stage workspace names within all deployment pipelines on my tenant. I was hoping to use the get pipeline stages api but the below code seems to return "Dev Workspace: <blank>"...

 

    $pipelines = (Invoke-PowerBIRestMethod -Url "pipelines"  -Method Get | ConvertFrom-Json).value
    $stageOrder=0
    Write-Host "Pipelines: "$pipelines
    foreach($p in $pipelines)
    {
        Write-Host "Pipeline: "$p
        $stagesUrl = "pipelines/{0}/stages" -f $p.Id
        $stageWorkspaces = (Invoke-PowerBIRestMethod -Url $stagesUrl  -Method Get | ConvertFrom-Json).value
        Write-Host "Stage Workspaces: "$stageWorkspaces
        $stageWorkspace = $stageWorkspaces.workspaceName | Where-Object {$_.order -eq $stageOrder}
        Write-Host "Dev Workspace: "$stageWorkspace
    }
1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @powerbi_jenhen,

Did the previous step 'stage workspace' display correctly? If that is the case, you can try to output them first then check the responded content and apply filters. 

In addition, the 'workspace name' parts seem not to be returned in each response content. Please check these response contents if you meet this scenario.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.