Jump to content

Part 2: Migrate Azure Analysis Services to Power BI Premium using Azure Databricks - How-To


Recommended Posts

Guest KatieCummiskey-Databricks
Posted

This post is authored in conjunction with Leo Furlong, Senior Solutions Architect, at Databricks.

 

 

 

Many customers choose to migrate their Azure Analysis Services semantic models to Power BI Premium due to the benefits and enhanced functionality described in the Power BI documentation. As customers migrate their semantic models to Power BI, native connections to Azure Databricks SQL become available due to the built-in Databricks SQL connector in Power BI. Databricks SQL Serverless combined with Power BI semantic models can provide customers with a number of benefits including a separation of compute and storage; instant, elastic compute; data refreshes charged by the second; and enterprise Data Warehouse functionality, query performance, and concurrency at any scale. The remainder of this article will focus on the in-and-outs of how to accomplish this migration.

 

 

 

[HEADING=1]Requirements[/HEADING]

 

 

 

[HEADING=1]Limitations[/HEADING]

  • AAS models migrated to Power BI Premium can’t be edited using web authoring per the documented limits, but as of writing this post, it does appear to allow web authoring on migrated models without issues/errors
  • AAS models migrated to Power BI can’t be downloaded to Power BI Desktop
  • Parallel connection configuration is only available in model Compatibility Level 1600+

 

 

 

Assumptions

 

  • Your data model in Databricks SQL is in the same structure as your current Azure Analysis Services model in terms of table/column names and column data types.
  • You are using the same Power BI storage modes as the previous model.

 

 

 

[HEADING=1]Migrate AAS Models to Power BI Premium[/HEADING]

 

You can migrate your Azure Analysis Services models to Power BI Premium in two primary ways: using the migration utility built into the Power BI Service or using Tabular Editor projects. The purpose of this blog post is not to focus on these migrations but on the post-migration conversation of the model to use Databricks SQL. Due to this fact, we’ll only briefly describe the AAS migration to Power BI Premium below.

 

 

 

[HEADING=2]Migrate AAS Models using the Power BI Migration Utility [/HEADING]

 

Microsoft provides a utility in the Power BI Service for migrating Azure Analysis Services models to Power BI Premium. For instructions on how to use the migration utility, see the following documentation page.

 

 

 

[HEADING=2]Migrate AAS Models using Tabular Editor[/HEADING]

 

Tabular models can also be migrated and deployed to Power BI Premium using Tabular Editor.

 

 

 

  1. Open the model.bim file using Tabular Editor and deploy it to Power BI Premium using the XMLA Endpoint.
  2. If you don’t have a Visual Studio project, open the Azure Analysis Services model directly using Tabular Editor and save it to a file.
  3. Open and deploy the semantic model file to Power BI Premium using the XMLA Endpoint.

 

Instructions on how to perform these steps are in the Ongoing Maintenance and Deployment using Tabular Editor section below.

 

 

 

[HEADING=1]Converting your post-migration Power BI Premium Semantic Model to use Databricks SQL Serverless[/HEADING]

 

After you've completed your migration to Power BI Premium, you’ll want to convert your Semantic Model to use Databricks SQL. This requires altering the PowerQuery code that forms the bedrock of your Semantic Model tables. The sections below describe how to perform this conversation using Tabular Editor. This is the primary focus of this post and we’ll review these conversation steps in detail. These steps could easily be automated using the Tabular Object Model, but this will be the topic of a future post.

 

 

 

[HEADING=2]Update M Code using Tabular Editor[/HEADING]

 

 

 

[HEADING=3]Tabular Editor 3 Flow[/HEADING]

 

1) Post Azure Analysis Services migration to Power BI Premium, obtain the “Workspace connection” from the Power BI Workspace settings Premium tab. Instructions here.

 

 

 

2) After opening the Tabular Editor 3 application, go to File -> Open -> Model from DB…

 

mediumvv2px400.png.4d804cf1da36b83b667ded94d617513c.png

 

 

 

 

 

3) In the Load Semantic Model from Database window, enter the workspace connection string obtained from step 1 into the Server field. Keep Authentication selected to Integrated and click OK.

 

mediumvv2px400.png.21291e8bbf743147527eb68da805e19f.png

 

 

 

 

 

4) Authenticate to the Power BI Service using your Microsoft Entra ID credentials.

 

 

 

5) Select the row for the model you want to open and click OK.

 

mediumvv2px400.png.03f5d9babb8faf062ed54c6e392282a4.png

 

 

 

 

 

6) Once the model is open, click on the Model icon in the TOM Explorer window. In the properties section, expand the Database section. Change the Compatibility Level to 1600+ and save the model.

 

mediumvv2px400.png.7a4424794e7a223c8ecdd0b8c4e6c84c.png

 

 

 

 

 

Save the model by clicking the “save changes back to the currently connected database” button.

 

mediumvv2px400.png.ad3533d4676dedc321f6d3984564fcbf.png

 

 

 

 

 

7) While still in model properties, optionally change the parallelism settings for the model which are explained in more detail in the Power BI documentation and PBI blog post. This step is recommended because Databricks SQL can handle query parallelism sent from Power BI beyond the default configurations. Possible values are in the grid below, but your mileage may vary and you may need to test.

 

 

 

Make sure to Save the model post configuration change.

 

 

 


Model Properties for Parallelism

Possible Values

Data Source Default Max Connections

value between 1 and 30

Max Parallelism Per Query

value between 0 and 30

Max Parallelism Per Refresh

value between -1 and 30

 

 

 

mediumvv2px400.png.d3a07e91924bba8016c7b48050786a2f.png

 

 

 

 

 

8) Create Shared Expressions (also known as Power BI Parameters in the UI) for the Databricks SQL connection information. For each expression, set the Kind property to M and set the expression values using the appropriate M formulas (examples below). G

et the Server Hostname and HTTP Path for your SQL Warehouse using these steps.

 

 

mediumvv2px400.png.383a9c4822983efe8afd347929186133.png

 

 

 

 

 


Expression Name

Kind

Expression

Server_hostname

M

"adb-5343834423590926.6.azuredatabricks.net" meta [isParameterQuery=true, Type="Text", IsParameterQueryRequired=true]

HTTP_path

M

"/sql/1.0/warehouses/66d1c1444dg06346" meta [isParameterQuery=true, Type="Text", IsParameterQueryRequired=true]

Catalog

M

"adventureworks" meta [isParameterQuery=true, Type="Text", IsParameterQueryRequired=true]

Schema

M

"adventureworksdw" meta [isParameterQuery=true, Type="Text", IsParameterQueryRequired=true]

 

 

 

mediumvv2px400.png.80b27006af22477dbe9937778daf23bb.png

 

 

 

 

 

mediumvv2px400.png.79f19188fa59038764a8eb6ffe336429.png

 

 

 

 

 

9) For each semantic model table and each partition in the table, change the M Expression and Mode to their appropriate values. An example of the M Expression is below that references the created expressions and leverages the native Databricks SQL connector in Power BI. For Mode, choose the correct Power BI Storage Mode for your semantic model table/partition based upon your use case.

 

 

 

Save the model after each table/partition modification.

 

 

 

mediumvv2px400.png.229a3357fd09b9e8264fd96dd4225549.png

 

 

 

 

 

mediumvv2px400.png.cfa412feac02115742fb1e273c11be97.png

 

 

 

 

 

M Expression Example for the Databricks SQL Connector using Expressions

 

let

 

Source = Databricks.Catalogs(Server_hostname, HTTP_path, null),

 

Database = Source{[Name=Catalog,Kind="Database"]}[Data],

 

Schema = Database{[Name=Schema,Kind="Schema"]}[Data],

 

Data = Schema{[Name="<your table or view name>",Kind="Table"]}[Data]

 

in

 

Data

 

 

 

10) Navigate to the Power BI Workspace and select settings for the semantic model being migrated from using the … menu. Click Edit and configure the data source credentials using the following documentation for reference.

 

 

 

11) Navigate back to Tabular Editor and “Update table schema…” by right-clicking on each table in the semantic model. If there are any metadata changes between the old and new data source, Tabular Editor will fix the definitions. Save the model.

 

 

 

mediumvv2px400.png.f332526ee69eb0300b5fd8851c8c88fc.png

 

 

 

 

 

Example of TE3 detecting a new column added to the table in Databricks SQL.

 

mediumvv2px400.png.4d4f615524edf02555cff8806f7bfcb7.png

 

 

 

 

 

12) Delete the old data sources under the Data Sources folder in Tabular Editor. Save the model. Note, Databricks SQL will not show up as a data source in this folder.

 

 

 

[HEADING=3]Using Tabular Editor 2 and Limitations[/HEADING]

 

All UI options and screens in Tabular Editor 2 will be similar to the Tabular Editor 3 steps above. Note, that Tabular Editor 2 doesn’t support automatic table metadata updates for Power Query data sources (new column data types, added or dropped columns, etc…). For information on how to update metadata manually, see the TE2 docs on Power Query data sources.

 

 

 

[HEADING=1]Ongoing Maintenance and Deployment using Tabular Editor[/HEADING]

 

Post-migration, one-time, and ongoing maintenance of your semantic model should be performed using Tabular Editor. Developers and organizations can choose to manage the lifecycle of their semantic model projects in their chosen Git repository tool. Development teams can work with their DevOps teams to implement CICD workflows within their DevOps tooling as required.

 

 

 

[HEADING=2]Manual Deployment[/HEADING]

 

Tabular Editor provides a Deployment wizard via the UI for manual deployments.

 

 

 

1) Obtain the “Workspace connection” from the Power BI Workspace settings Premium tab. Instructions here.

 

 

 

2) Open your semantic model project from File -> Open -> From File…

 

mediumvv2px400.jpg.655aa29158c949b256a294facd8c8579.jpg

 

 

 

 

 

3) After making changes to your semantic model that you’d like to deploy, enter into the Deployment wizard from Model -> Deploy…

 

mediumvv2px400.jpg.ea210a30a783d1f6ce5546363e971e1b.jpg

 

 

 

 

 

4) Enter the workspace connection (XMLA endpoint) string from your Power BI Workspace. Use Azure AD login Authentication and click Next >. Authenticate using your Entra credentials and MFA.

 

mediumvv2px400.jpg.38b93c861b7d16c488b383ea6e09f3d3.jpg

 

 

 

 

 

5) Select the existing Database you want to deploy into and Click Next >.

 

mediumvv2px400.jpg.7e67d737e60fad223ec7f1b5f34486d7.jpg

 

 

 

 

 

6) Select your deployment options and click Next >.

 

mediumvv2px400.jpg.dc5b8c7d119c512d63a5fa3e985ff216.jpg

 

 

 

 

 

7) In the final step, you can choose to deploy directly from the UI by clicking Deploy. You can also export your deployment to a TMSL Script and execute it from SQL Server Management Studio or another compatible IDE.

 

mediumvv2px400.jpg.b6968af3e99f79807db271e66c26d94a.jpg

 

 

 

 

 

8) If you deploy from the UI, a message will be displayed in the bottom left-hand corner of Tabular Editor if the deployment was successful.

 

mediumvv2px400.jpg.c940bfd8e7a5a75137308a41c2ff448e.jpg

 

 

 

 

 

All UI options and screens in Tabular Editor 2 will be similar to the Tabular Editor 3 steps above.

 

 

 

[HEADING=2]Automated Deployment and CICD integration [/HEADING]

 

Tabular Editor provides automated deployment options, including CICD integration from DevOps tools like Azure DevOps or GitHub Actions via command line deployments. Please refer to the following blog posts and GitHub Repo for more information and examples of these deployment options.

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...