Using Data Migration Assistant to assess an application’s data access layer
Published Nov 06 2019 04:15 PM 29.7K Views
Microsoft

Applications typically connect and persist data to a database. The data access layer of the application provides simplified access to this data. Data Migration Assistant (DMA) has enabled users to assess their databases and related objects. The latest version of DMA (v5.0) introduces support for analyzing database connectivity and embedded SQL queries in the application code.

 

Consider the simple C# code segment below:

 

clipboard_image_0.png

 

In this case, you can see that the application is using a SQL query to get the name of an employee.

 

clipboard_image_1.png

 

As an application owner, I need to be able to identify the various databases that the application can connect to and the queries embedded in the application’s data access layer. In addition, I need to identify any changes required to modernize the application to Azure Data services.

 

To enable this assessment, we recently introduced the Data Access Migration Toolkit (DAMT), a Visual Studio Code extension. The latest version (v 0.2) of this extension adds support for .Net applications and T-SQL dialect.

 

Download and install VS Code from http://code.visualstudio.com/download.

 

Enable the Data Access Migration Toolkit extension from the Extensions Marketplace.

clipboard_image_2.png

 

Open the application project in Visual Studio Code.

 

clipboard_image_3.png

 

Start the extension console (Ctrl-Shft-P), and then run the Data Access: Analyze Workspace command.

 

clipboard_image_4.png

 

Select the SQL Server dialect.

 

clipboard_image_5.png

 

At the end of the analysis, the command produces a report of SQL connectivity commands and queries.

 

clipboard_image_6.png

 

Review the report for data connectivity components and for SQL queries embedded in the application code. These are highlighted in the code as well.

 

clipboard_image_0.png

 

These queries can be analyzed through DMA for compatibility and feature parity issues based on the target SQL platform.

 

To assess the application’s data layer, export the report as json file.

 

clipboard_image_1.png

 

In this case, the generated file is:

 

clipboard_image_2.png

 

Data Migration Assistant enables assessing the queries identified in the application within the context of modernizing the database to Azure Data platform.

 

Start Data Migration Assistant and create and assessment project.

 

clipboard_image_3.png

 

Select source SQL instance.

 

clipboard_image_4.png

 

Select the database the application is connecting to.

 

clipboard_image_5.png

 

To facilitate data access assessment, DMA introduces the ability to include json files with application queries. Next, we’ll include the json file we crafted earlier with the application queries.

 

Select the database and browse to the json file exported from Data Access Migration Toolkit to include the queries from the application for the assessment.

 

clipboard_image_6.png

 

Start the assessment.

 

clipboard_image_7.png

 

Review the assessment report. The generated report will include any compatibility or feature parity issues detected in the application queries as shown below.

 

clipboard_image_8.png

 

Now, in addition having the database perspective of the migration, users also have a view from the application perspective.

6 Comments

Thank you for Sharing, Awesome blogpost :cool:

Copper Contributor

Hi,

 

  This option already seemed in the previous version of the product but I don't know what it is for:

 

clipboard_image_0.png

Please, could you explain us?

Thanks.

Microsoft

@José Antonio Pineda, in DMA v4.3, we introduced the ability to read from XEvents to assess (Add databases and extended events trace to assess). With this new release (v5.0), we've added support for Json files created using the Data Acess Migration Toolkit. In other words, from application source code loaded in VSCode, you can identify SQL queries and feed them into DMA for assessment.

Copper Contributor

Jim,

     I have a doubt, when you use XEvents to assess , you must select all databases of the SQL or are indepedent , in other word, if the XEvent have TSQL without filter by database then I must to select all databases in the DMA app. 

 

clipboard_image_0.png

Copper Contributor

Hi,

how much resource required to Start Data Migration Assistant and create and assessment project...!!!!!

what will be Database size limit!!

Copper Contributor

hi you all

Version history
Last update:
‎Nov 07 2019 10:21 AM
Updated by: