Forum Discussion

YULIU11's avatar
YULIU11
Regular Visitor
3 years ago

REST API only deploys repot or Dashboard separately with powershell

As we know, we could use the deployment pipeline only deploy the report or Dashboard from Dev environment to the next environment, like SIT.

Now I want to use the powershell invoke the REST API to complete this, but I am not familiar with power bi's REST API, any suggestion?

Please don't just provide an official API link, a specific sample would be better.

3 Replies

  • Hi, I'm sorry, I know  you don't want docs, but it will be necessary because you can't run deployment pipeline actions from regular PowerShell cmdlets, you must use invoke rest method or run it from a different code.

    https://learn.microsoft.com/en-us/rest/api/power-bi/pipelines/selective-deploy

    I'm not an powershell expert but I'm guessing it would be like:

    PS C:\> Invoke-PowerBIRestMethod -Url 'pipelines/{pipelineId}/deploy' -Method Post

    That should run the Deployment Pipeline deploy from code.

    I hope that helps,

    • YULIU11's avatar
      YULIU11
      Regular Visitor

      I also checked that doc, but it seems we need to create the depolyment pipeline at first, then I can use that REST API to deploy the Report. 

      • ibarrau's avatar
        ibarrau
        Super User

        Well yes. The request is to deploy between environments already created by Deployment Pipelines. What is it that you want to do? I'm not sure I'm following now. Is it copying between workspaces without that feature?

        Regards,