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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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