I am wondering how is possible to create a TMSL script from an tabular database (power bi service or SSAS) using some programing language. These kind of scripts are available in several tools, like SSMS or Tabular Editor:

Example of the menu to create TMSL script in SSMS from an active DB

What creates (as an example) something like this:

Example: A TMSL script header for a role

So, the question is if, for example, a python library / .NET wrapper could do that automatically. I am able to send several DMVs using pyadomd to extract the information by parts (with several lookups in alternate tables to transforms ids) and then recompose everything into an script, but if where a easy way to create it could less error prone and time saver.

Thanks in advance Alexis

1

There are 1 best solutions below

2
On BEST ANSWER

IT's a .NET Library called Tabular Object Model, which can be used to read Tabular Model metadata and generate scripts using the JSON Scripter.