microsoft / powerbi-powershell

PowerShell community for Microsoft PowerBI. Here you will find resources and source for PowerShell modules targeting PowerBI.
MIT License
345 stars 119 forks source link

Dataflow Management Support #322

Open pranavrajtyagi-ab opened 3 years ago

pranavrajtyagi-ab commented 3 years ago

We are currently working to setup GitHub actions for Data flow deployments. We use SPNs but Dataflows management is not supported using SPN. https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal#considerations-and-limitations

While we invoke the following: Invoke-PowerBIRestMethod -Url $url -Method Post -Body $body | ConvertFrom-Json we get:

Invoke-PowerBIRestMethod: /Users/*********: 
Line |
  88 |  … loyResult = Invoke-PowerBIRestMethod -Url $url  -Method Post -Body $b …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | One or more errors occurred. (Response status code does not indicate success: 400 (Bad Request).)
vasudevpatil commented 2 years ago

Hello @pranavrajtyagi-ab, Yes it appears that above mentioned method of invoking REST API is not working for dataflow deployment. Though there is a work around and its available within this Repo: https://github.com/microsoft/powerbi-powershell/tree/master/examples/dataflows refer below script for the solution: https://github.com/microsoft/powerbi-powershell/blob/master/examples/dataflows/ImportModel.ps1