mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
* Adding migration service to sql migrations * enabling auto flush log * Adding support for env variable * Adding TDE Migration service * code cleanup * updating service downloader * Removing custom output channel * remove unnecessary await * Updated service version to get latest code * Consolidate TDE into migration service * Sync to latest main * Update sql-migration package version * Fix merge conflict error * Fixing all merge conflicts * Fixing stuff * removing extra whitespace * Cleaning up --------- Co-authored-by: Akshay Mata <akma@microsoft.com>
3.0 KiB
3.0 KiB
SQL Migration Extension Developer Guide
SQL migration utilizes a backend service to execute assessments and provide SKU recommendations. The source code for the backend service can be found at Microsoft.SqlTools.Migration.
During regular usage of the extension, the backend service is downloaded from a URL specified in the config.json file.
When developing the extension, it is possible to run the backend service locally and debug the extension against the local backend service. This guide will walk you through the necessary steps to do so.
Using ADS_MIGRATIONSERVICE environment variable
- Clone the sqltoolsservice repository by running
git clone git@github.com:microsoft/sqltoolsservice.git - Navigate to the migration folder by running
cd src/Microsoft.SqlTools.Migration - Publish the project by running
dotnet publish -r <platform>(e.g.dotnet publish -r win-x64). This will publish the project to a folder similar tobin/Debug/net7.0/<platform>/publish/ - In a terminal window, set the
ADS_MIGRATIONSERVICEenvironment variable to the full path of the publish folder from the previous step. For example:$ENV:ADS_MIGRATIONSERVICE=/Users/username/sqltoolsservice/src/Microsoft.SqlTools.Migration/bin/Debug/net7.0/win-x64/publish - Launch Azure Data Studio from the same terminal where you set the environment variable. When the migration service is activated, it will use the backend service from the environment variable path.
- You should see a pop-up notification indicating that the migration service is running from the environment variable path. If this notification does not appear, check that the environment variable is spelled correctly and that it points to the correct directory.
- After making changes to the service, you can republish the project and launch Azure Data Studio again from the same terminal where you set the environment variable.
Replacing the Binaries Manually
- Close any running instances of Azure Data Studio.
- Copy the publish folder from
src/Migration.SqlTools.Migration/bin/Debug/net7.0/<platform>/publish/tosrc/extensions/sql-migration/. For example:cp -r <src>/sqltoolsservice/src/Microsoft.SqlTools.Migration/bin/Debug/net7.0/win-x64/publish <src>/azuredatastudio/extensions/sql-migration/migrationService/<platform>/<version>/ - Launch Azure Data Studio from
<src>/azuredatastudio
Debugging the extension service:
The logs for the extension and service during runtime can be accessed by:
- Opening the command palette (Ctrl+P) and searching for "Developer: Open Extensions Logs Folder"
- Opening the Microsoft.sql-migration folder to access the log files. You will see three different log files:
MicrosoftSqlToolsMigration: logs for the migration serviceSqlAssessmentReport-<TIMESTAMP>: report generated everytime user runs the assessmentSqlAssessmentsLogs: folder that contains runtime logs for the assessments