Forum Discussion

cte_crest's avatar
cte_crest
Helper I
6 years ago

Can we create a template app with Push Dataset?

Hi folks,

 

I am learning PowerBI and the experience has been great lately. I am thinking about one of the possible ways to fulfil my use case. I want to publish a template app on the Microsoft AppSource. Now, the app will have a sample dataset shipped with it. In all the general use cases of other apps, I see that the data in the shipped dataset is usually refreshed through native connector mechanism, i.e., through M Query. Now, is there a way that after installing the template app from the app source, user pushes the data to that data set through rest API?

 

Currently, when I loaded a pbix file in PowerBI service, and  I was not able to retrieve the data set supplied in pbix file through rest API.

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi cte_crest,

    I'd like to suggest you use 'power bi service' connect to get data from power bi service, it linked with your power bi account and you can access existing datasets.

    If you mean get data from the root URL of power bi datasets, I'd like to suggest you take a look at azure blob storage API. (AFAIK, power bi host its dataset on azure blob storage data source)

    Regards,

    Xiaoxin Sheng

    • cte_crest's avatar
      cte_crest
      Helper I

      Anonymous 

      Thanks for your reply. Actually, I want to push data to the dataset on template apps.

      So, let me try to put it in a concise way, about the steps I performed:

      1. For adding data to powerBI dataset, I want to use Push mechanism through API.
      2. So, I created some tables in a data set through push api data set and corresponding reports and exported pbix file which I want different users to use as a template app. (I think this is also what will go on the app source when template app will be published.)
      3. Now, I imported the pbix file, in a new workspace where I get all my reports and data set as well. 
      4. I tried to push data to this data set using powerBI api. That's when I encountered error, indicating that this dataset doesn't support push mechanism.

      So, do you think this could be solved? Or am I using it all wrong? 

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI cte_crest,

        Please double-check on Push datasets REST API limitations, it only allows on push dataset and not works on common datasets that publish form pbix file. Push Datasets 

        Regards,

        Xiaoxin Sheng

  • Teddyb's avatar
    Teddyb
    Microsoft Employee

    Hi, 

     

    Sorry for the late reply, indeed template apps are a great way to create deployable solution and publish on AppSource but they rely on Connectors extensibility story. 

     

    If you own the datasource you can apply to certify your connector which will allow the template app use the certified connector.

    Maybe the datasource you are trying to connect with support OData? 

     

  • Hi Teddyb ,

     

    Are you saying that it is not possible to create template apps out of workspaces that have ONLY push datasets created through the API?

     

    I, for example, have created a new workspace with datasets, tables and the data therein only through the REST API. Now that I want to create an app out of it, it asks me to complete all the fields with as asterix on it 

    Not quite done

    and then takes me to the Authentication tab.

     

    And there I only see a spinning wheel that says Loading indefinitely.

    Spinning wheel

    This makes it hard to zero in on the real issue. Is this a bug on the service?

     

    Note that I have not used PBIX file for anything here- its all built up online. All datasets were created out of the API. And none of the tables have any data source associated with it. 

     

    Any ideas whats wrong?

     

    Dataset and content was created using this code,

     

     

                    // create dataset and table
                    Dataset shippedProductsDataSet = await this.GetDataSet(client, "ShippedProducts");
                    if (shippedProductsDataSet == default(Dataset))
                    {
                        var createDataSet = new CreateDatasetRequest(
                            "ShippedProducts",
                            new List<Table>
                            {
                                new Table(
                                    "Product",
                                    new List<Column>
                                    {
                                        new Column("Id", "string"),
                                        new Column("Name", "string")
                                    }));
                        shippedProductsDataSet = client.Datasets.PostDatasetInGroup(PBIWorkSpaceId, createDataSet);
                    }
                    shippedProductsDataSet = client.Datasets.PostDatasetInGroup(PBIWorkSpaceId, createDataSet);
    
    
                    // Create sample data
                    var tables = client.Datasets.GetTablesInGroup(PBIWorkSpaceId, shippedProductsDataSet.Id);
                    if (!tables.Value.Any(t => t.Name == "Product" && t.Rows != null && t.Rows.Count > 0))
                    {
                        var productPostRowsRequest = new PostRowsRequest(
                            new List<object>
                            {
                            new {Id = 1, Name = "A"},
                            new {Id = 2, Name = "B"},
                            new {Id = 3, Name = "C"}
                            });
                        client.Datasets.PostRowsInGroup(PBIWorkSpaceId, shippedProductsDataSet.Id, "Product", productPostRowsRequest);
                    }