Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Import to group via API

I am working on a PowerShell function to import .pbix files via the API. The main functionality is taken from the oft referenced sample code here https://github.com/Azure-Samples/powerbi-powershell/b...
  • Anonymous's avatar
    Anonymous
    7 years ago

    I narrowed down the bug and found a workaround. (Or rather, I found the workaround, which informed the bug.)

     

    The API is generally case insensitive. As a long time PowerShell guy, I default to initial caps in such circumstances, as that's what PowerShell people are used to. Turns out this bug only appears when /groups is not in all lowercase. /Imports can be in whatever case you want. /Groups can be whatever case you want in other API calls.

     

    But when creating a new import job, this works:

    https://api.powerbi.com/v1.0/myorg/groups/[guid]/ImPoRtS?datasetDisplayName=TestFile.pbix

    And this leads to the bug:

    https://api.powerbi.com/v1.0/myorg/Groups/[guid]/Imports?datasetDisplayName=TestFile.pbix

     

    Thanks,

    Tim Curwick.