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.
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.
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 ?
LikeLike
I use VS code, but Notepad++ should be able to “pretty format” JSON with the right add-in
https://stackoverflow.com/questions/1560464/how-to-reformat-json-in-notepad
LikeLike
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!
LikeLike
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…
LikeLike
Hey Matt and Jackie,
I saw the same thing oddly even when I didn’t have any native queries within my exported dataflow. I had to modify the model json exported file manually and set the allowNativeQueries value to false then I was able to import the model fine. I see another report of it here:
https://community.powerbi.com/t5/Issues/Dataflow-import-requires-AllowNativeQueries-attribute-to-be/idi-p/820972
LikeLike
Hey Matt and Jackie,
I saw the same thing oddly even when I didn’t have any native queries within my exported dataflow. I had to modify the model json exported file manually and set the allowNativeQueries value to false then I was able to import the model fine. I see another report of it here:
https://community.powerbi.com/t5/Issues/Dataflow-import-requires-AllowNativeQueries-attribute-to-be/idi-p/820972
LikeLike
Is there a C# class wrapper for dataflow models? And are there any examples of creating these dataflows via API?
LikeLike
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.
LikeLike
Is there a C# class wrapper for dataflow model files? And are there any examples of performing this dataflow creation programmatically?
LikeLike
Pingback: Power BI dataflows PowerShell scripts on GitHub – BI Polar