Power BIte: Creating dataflows by importing model.json

Important: This post was written and published in 2019, and the content below may no longer represent the current capabilities of Power BI. Please consider this post to be an historical record and not a technical resource. All content on this site is the personal output of the author and not an official resource from Microsoft.

This week’s Power BIte is the third in a series of videos[1] that present different ways to create new Power BI dataflows, and the results of each approach.

When creating a dataflow by importing a model.json file previously exported from Power BI, the dataflow will have the following characteristics:

Attribute Value
Data ingress path Ingress via the mashup engine hosted in the Power BI service.
Data location Data stored in the CDM folder defined for the newly created dataflow
Data refresh The dataflow is refreshed based on the schedule and policies defined in the workspace.

Let’s look at the dataflow’s model.json metadata to see some of the details.

2019-11-06-14-50-53-981--Code

At the top of the file we can see the dataflow name on line 2…

…and that’s pretty much all that’s important here. The rest of the model.json file will exactly match what was exported from the Power BI portal, and will look a lot like this or this. Boom.

For a little more detail (and more pictures, in case you don’t want to watch a four minute video) check out this post from last month, when this capability was introduced.

If this information doesn’t make sense yet, please hold on. We still have one more incoming Power BIte in this series, and then we’ll have the big picture view.

I guarantee[3] it will make as much sense as anything on this blog.


[1] New videos every Monday morning![2]

[2] Did you notice that I just copied the previous post and made some small edits to it? That seemed very appropriate given the topic…

[3] Or your money back.

10 thoughts on “Power BIte: Creating dataflows by importing model.json

  1. Steven Bengtson

    Hi Matthew, i have a “stupid question” for you ! When I export the dataflow JSON file and try and view it in notepad ++ as an example (and turn on JSON language mode) – its just not formatting correctly. Even notepad normally shows JSON in a readable format – but the file produced seems to be just one loooonnngg string. What JSON viewer do you use ?

    Like

  2. Jackie

    Hi Matthew, I can successfully export a json dataflow but get a “Can’t publish dataflow” error when I go to import.

    Invalid dataflow parameter value. Exception details: The AllowNativeQueries attribute of the mashup is set to true for this definition. For security reasons, AllowNativeQueries should be set to false on import (can be set to true after import from the Power BI Services). Please set AllowNativeQueries to false and try again.

    Have you seen this error? I can’t find where the set AllowNativeQueries in dataflows.

    Thank you!

    Like

    1. I have not seen this, and the scenario doesn’t make sense to me. You’re exporting the JSON for a dataflow that includes native queries, but you’re getting this error when importing that JSON back into Power BI?

      My educated guess (emphasis on “guess”) is that the “import json” path doesn’t include the necessary validation for native queries, and that for this you would need to go through Power Query Online. With that said, if you want an authoritative response and not a guess, I’d recommend opening a support ticket or asking a question on community.powerbi.com…

      Like

    1. I’m not aware of wrappers for any of the Power BI REST APIs.

      The dataflows API docs are here: https://docs.microsoft.com/en-us/rest/api/power-bi/dataflows

      The API to create a dataflow is the Post Import in Group API, documented with example here: https://docs.microsoft.com/en-us/rest/api/power-bi/imports/postimportingroup

      There are mechanisms on each doc page to provide feedback, and the folks who own the documentation actively monitor that feedback.

      Like

  3. Pingback: Power BI dataflows PowerShell scripts on GitHub – BI Polar

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s