Forum Discussion

Dan2's avatar
Dan2
Helper I
8 years ago
Solved

Parameters not being published when using the powerbi rest import method

Part of our deployment process is upload pbix files to the apropriate workspace based on environment, etc. And this deployment process uses the powerbi rest api's import method to do this. We use parameters in the dataset which tells the powerbi report which server to authenticate too. But when using the import api method the parameters do not come across. The only way I have found to get the parameters into the dataset is to use the publish button which is inside the powerbi fat client. I have also verified the parameters do not come across when using the import method by viewing the parameters in powerbi.com which is blank and also by calling the powerbi rest api get parameters method which returns no parameters.

 

So the question is there a limitation on using the import api rest method that does not allow the parameters to be pulled into the dataset?

 

Note 1: I have verified that the "Enable Load" has been checked on the parameter and it has no effect on the issue.

 

Note 2: A working example of a postman call showing how I import the pbix file. It works great, just doesn't import the parameters that exists already in the pbix file. (values are scrubbed):

 

POST /v1.0/myorg/groups/xxx/imports?datasetDisplayName=mydataset001&nameConflict=CreateOrOverwrite HTTP/1.1

Host: api.powerbi.com
Authorization: Bearer xxxx

Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Cache-Control: no-cache

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="filePath"

C:\VSTS\Dev4\Development\Reporting\PowerBI\DeploymentFiles\myparametertestfile.pbix
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name=""; filename="myparametertestfile.pbix"
Content-Type:
------WebKitFormBoundary7MA4YWxkTrZu0gW--

 

Thanks.

  • I had a discussion with Microsoft and found that if the parameters are not being used in the advanced query editor then when using the powerbi rest api import method the parameters will not be migrated. So you must be using these parameters in some way otherwise the parameters will not make it into the dataset.

5 Replies

  • Part of our deployment process is upload pbix files to the apropriate workspace based on environment, etc. And this deployment process uses the powerbi rest api's import method to do this. We use parameters in the dataset which tells the powerbi report which server to authenticate too. But when using the import api method the parameters do not come across. The only way I have found to get the parameters into the dataset is to use the publish button which is inside the powerbi fat client. I have also verified the parameters do not come across when using the import method by viewing the parameters in powerbi.com which is blank and also by calling the powerbi rest api get parameters method which returns no parameters.

     

    So the question is there a limitation on using the import api rest method that does not allow the parameters to be pulled into the dataset?

     

    Note 1: I have verified that the "Enable Load" has been checked on the parameter and it has no effect on the issue.

    Note 2: A working example of a postman call showing how I import the pbix file. It works great, just doesn't import the parameters that exists already in the pbix file. (values are scrubbed):

     

    POST /v1.0/myorg/groups/xxx/imports?datasetDisplayName=mydataset001&nameConflict=CreateOrOverwrite HTTP/1.1

    Host: api.powerbi.com
    Authorization: Bearer xxxx

    Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
    Cache-Control: no-cache

    ------WebKitFormBoundary7MA4YWxkTrZu0gW
    Content-Disposition: form-data; name="filePath"

    C:\VSTS\Dev4\Development\Reporting\PowerBI\DeploymentFiles\myparametertestfile.pbix
    ------WebKitFormBoundary7MA4YWxkTrZu0gW
    Content-Disposition: form-data; name=""; filename="myparametertestfile.pbix"
    Content-Type:
    ------WebKitFormBoundary7MA4YWxkTrZu0gW--

     

    Thanks.

    • Dan2's avatar
      Dan2
      Helper I

      I had a discussion with Microsoft and found that if the parameters are not being used in the advanced query editor then when using the powerbi rest api import method the parameters will not be migrated. So you must be using these parameters in some way otherwise the parameters will not make it into the dataset.

      • jaryszek's avatar
        jaryszek
        Super User

        Hello Dan2

        I have the same issue like you.
        What do you mean by some way? 

        I have query where I am using parameter like here:

        let
            Source = AzureStorage.Blobs("vncmcostexports"),
            powerbidatasources1 = Source{[Name="powerbidatasources"]}[Data],
            #"Filtered Rows" = Table.SelectRows(powerbidatasources1, each ([Name] = "AvailabilitySets.csv")),
            #"Filtered Hidden Files1" = Table.SelectRows(#"Filtered Rows", each [Attributes]?[Hidden]? <> true),
            #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
            #"Removed Other Columns" = Table.SelectColumns(#"Invoke Custom Function1",{"Name", "Content"}),
            #"Invoke Custom Function2" = Table.AddColumn(#"Removed Other Columns", "Transform File", each #"Transform File"([Content])),
            #"Removed Other Columns1" = Table.SelectColumns(#"Invoke Custom Function2", {"Transform File"}),
            Headears =  #"Removed Other Columns1"{0}[Transform File],
            Result = if NoData = true then #table(Table.ColumnNames(Headears), {}) else Headears
        in
            Result

         and parameter is: 


        why this is not working? 
        After importing using REST APIs they are disappearing...

        Best,
        Jacek