diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Allow_to_open_SSMS.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Allow_to_open_SSMS.png new file mode 100644 index 000000000..1e092ef78 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Allow_to_open_SSMS.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResult01.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResult01.png new file mode 100644 index 000000000..06462b1fd Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResult01.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResult02.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResult02.png new file mode 100644 index 000000000..b372fe74f Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResult02.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResultDetails01.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResultDetails01.png new file mode 100644 index 000000000..1b10d4082 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResultDetails01.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResultDetails02.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResultDetails02.png new file mode 100644 index 000000000..5c12ecd8c Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/AssessmentResultDetails02.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Bastion-VM11.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Bastion-VM11.png new file mode 100644 index 000000000..b2f832f46 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Bastion-VM11.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Connect_Github.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Connect_Github.png new file mode 100644 index 000000000..bab160e44 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Connect_Github.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/DB_RemovedFrom_AG.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/DB_RemovedFrom_AG.png new file mode 100644 index 000000000..87b694bdd Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/DB_RemovedFrom_AG.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_Approve.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_Approve.png new file mode 100644 index 000000000..7f5df94e2 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_Approve.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_MissingIndex.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_MissingIndex.png new file mode 100644 index 000000000..109fa73a1 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_MissingIndex.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_SqlInjectionProc.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_SqlInjectionProc.png new file mode 100644 index 000000000..e3bd2780b Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_SqlInjectionProc.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_performance_prompt.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_performance_prompt.png new file mode 100644 index 000000000..d42a33644 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/GithubCopilot_performance_prompt.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Approve_Access_to_assessment_report.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Approve_Access_to_assessment_report.png new file mode 100644 index 000000000..055d47a26 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Approve_Access_to_assessment_report.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Authorize.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Authorize.png new file mode 100644 index 000000000..4c2149f6c Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Authorize.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Continue.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Continue.png new file mode 100644 index 000000000..2abeedaf5 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Continue.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker01.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker01.png new file mode 100644 index 000000000..457636442 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker01.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker02.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker02.png new file mode 100644 index 000000000..e57ed4766 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker02.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker03.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker03.png new file mode 100644 index 000000000..dbf825972 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker03.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker04.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker04.png new file mode 100644 index 000000000..3d0479197 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Identifies_Blocker04.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Login.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Login.png new file mode 100644 index 000000000..843c4a2de Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Login.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Prompt_Challenge01.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Prompt_Challenge01.png new file mode 100644 index 000000000..006a8f54e Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Github_Prompt_Challenge01.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard01.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard01.png new file mode 100644 index 000000000..5c75aec75 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard01.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard02.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard02.png new file mode 100644 index 000000000..2ef762eae Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard02.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard03.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard03.png new file mode 100644 index 000000000..9b35e234f Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard03.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard04.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard04.png new file mode 100644 index 000000000..4cf55ec6b Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard04.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard05.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard05.png new file mode 100644 index 000000000..5f07fb47a Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard05.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard06.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard06.png new file mode 100644 index 000000000..366b8ca52 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard06.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard07.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard07.png new file mode 100644 index 000000000..32f273594 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard07.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard08.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard08.png new file mode 100644 index 000000000..39fbd36ba Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard08.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard09.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard09.png new file mode 100644 index 000000000..56c26d255 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink-Wizard09.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_AG_View.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_AG_View.png new file mode 100644 index 000000000..981d2feb3 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_AG_View.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover.png new file mode 100644 index 000000000..260b90c84 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard01.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard01.png new file mode 100644 index 000000000..ab1553928 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard01.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard02.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard02.png new file mode 100644 index 000000000..6e50b1ae7 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard02.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard03.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard03.png new file mode 100644 index 000000000..5be6ca4e4 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard03.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard04.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard04.png new file mode 100644 index 000000000..52f413b17 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard04.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard05.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard05.png new file mode 100644 index 000000000..e91b8a357 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard05.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard06.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard06.png new file mode 100644 index 000000000..52a351165 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard06.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard07.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard07.png new file mode 100644 index 000000000..5002fe68a Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard07.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard08.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard08.png new file mode 100644 index 000000000..b4b00c0db Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MILink_Failover_Wizard08.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Migrate SQL Server.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Migrate SQL Server.png new file mode 100644 index 000000000..df4bdf2b2 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Migrate SQL Server.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Migrate Screen.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Migrate Screen.png new file mode 100644 index 000000000..53600b0cc Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Migrate Screen.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Migrate_with_MI_Link.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Migrate_with_MI_Link.png new file mode 100644 index 000000000..8615ac81e Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Migrate_with_MI_Link.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/MigrationArchitecturev2.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MigrationArchitecturev2.png new file mode 100644 index 000000000..823d19b06 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/MigrationArchitecturev2.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/Run Readiness Assessment.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Run Readiness Assessment.png new file mode 100644 index 000000000..d9e1427d1 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/Run Readiness Assessment.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/SQLMicroHack_SmartModernization.jpeg b/03-Azure/01-02 Data/02-SQL_Modernization/Images/SQLMicroHack_SmartModernization.jpeg new file mode 100644 index 000000000..7fbca8a24 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/SQLMicroHack_SmartModernization.jpeg differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/SSMS start menu.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/SSMS start menu.png new file mode 100644 index 000000000..8c83cb296 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/SSMS start menu.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/SSMS_Github_Chat.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/SSMS_Github_Chat.png new file mode 100644 index 000000000..62bafce19 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/SSMS_Github_Chat.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/check_MILink_Sync.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/check_MILink_Sync.png new file mode 100644 index 000000000..b460c13c1 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/check_MILink_Sync.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Images/shortcuts.png b/03-Azure/01-02 Data/02-SQL_Modernization/Images/shortcuts.png new file mode 100644 index 000000000..2b4cc11f5 Binary files /dev/null and b/03-Azure/01-02 Data/02-SQL_Modernization/Images/shortcuts.png differ diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/Readme.md b/03-Azure/01-02 Data/02-SQL_Modernization/Readme.md index a626dc446..72110f1a3 100644 --- a/03-Azure/01-02 Data/02-SQL_Modernization/Readme.md +++ b/03-Azure/01-02 Data/02-SQL_Modernization/Readme.md @@ -1,7 +1,7 @@ -![image](./Images/SQLMicroHack.jpg) +![image](./Images/SQLMicroHack_SmartModernization.jpeg) -# MicroHack - SQL modernization +# MicroHack - Smart Modernization : SQL + AI in Action - [**MicroHack introduction**](#MicroHack-introduction) - [**MicroHack context**](#microhack-context) @@ -11,9 +11,9 @@ # MicroHack introduction -This MicroHack scenario walks through the use of database migration with a focus on the best practices and the design principles. Specifically, this builds up to include working with an existing infrastructure. +This MicroHack scenario walks through the use of database migration with a focus on the best practices and the design principles. Specifically, this builds up to include working with an existing infrastructure. It also includes the usage of Github Copilot to make your work with databases smarter. -This MicroHack will enhance your understanding of SQL modernization and migration paths, including how to assess and migrate SQL Server databases to Azure SQL, administer and monitor Azure SQL Managed Instance, and ensure the security of Azure SQL Managed Instance services. Specifically, to bring Azure SQL family closer to the participants, making the value of platform services more concrete and understandable through hands-on labs and presentations. +This MicroHack will enhance your understanding of SQL modernization and migration paths, including how to assess and migrate SQL Server databases to Azure SQL, administer and monitor Azure SQL Managed Instance, and ensure the security of Azure SQL Managed Instance services. Specifically, to bring Azure SQL family closer to the participants, making the value of platform services more concrete and understandable through hands-on labs and presentations. Finally leveraging the new capabilities of AI for your database environment on-premises, hybrid and in the cloud. # MicroHack context @@ -23,11 +23,12 @@ This MicroHack scenario walks through modernizing SQL Server workloads to Azure, After completing this MicroHack you will be able to: -* Implement a proof-of-concept (PoC) for migrating an on-premises SQL Server 2012 or SQL Server 2016 database into Azure SQL Database Managed Instance (SQL MI) +* Implement a proof-of-concept (PoC) for migrating an on-premises SQL Server 2016 database into Azure SQL Database Managed Instance (SQL MI) * Perform assessments to reveal any feature parity and compatibility issues between the on-premises SQL Server database and the managed database offerings in Azure * Migrate the on-premises databases into Azure, using Azure migration services * Enable some of the advanced SQL features available in SQL MI to improve security and performance in your customer's application * Understand how to to implement a cloud migration solution for business-critical applications and databases +* Learn how to leverage Github Copilot to work smarter and get easier insights # MicroHack challenges @@ -57,5 +58,5 @@ This MicroHack has a few but important prerequisites ## Contributors * Cornel Sukalla [LinkedIn](https://www.linkedin.com/in/cornelsukalla/) -* Mert Següner [LinkedIn](https://www.linkedin.com/in/mertsenguner/) +* Oliver Hahn [LinkedIn](https://www.linkedin.com/in/oliver-hahn-ms/) * Sean Cowburn [LinkedIn](https://www.linkedin.com/in/sean-cowburn/) diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-01.md b/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-01.md index abe36f6ee..9d090bb47 100644 --- a/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-01.md +++ b/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-01.md @@ -1,23 +1,25 @@ -# Challenge 1 - Assessment and migration with Azure Data Studio +# Challenge 1 - Assessment and migration with SQL Server Management Studio **[Home](../Readme.md)** - [Next Challenge Solution](challenge-02.md) ## Goal -The goal of this exercise is to migrate an on-premises SQL Server 2012 database to Azure SQL Database Managed Instance (SQL MI). +The goal of this exercise is to migrate an on-premises SQL Server 2016 database to Azure SQL Database Managed Instance (SQL MI). ## Actions * Perform assessments to reveal any feature parity and compatibility issues * Analyze workload to identify the appropriate SKU size -* Migrate the on-premises databases into Azure, using Azure migration services +* Use Github Copilot to get detailed instructions to remove migration blockers +* Migrate the on-premises databases into Azure, using SSMS ## Success criteria * You successfully assessed the databases against the SQL PaaS target architectures -* You successfully captured the workload and received SKU sizing guidance +* You successfully captured the workload and received SKU sizing guidance +* You successfully used Github Copilot to identify and remove migration blockers * You have successfully migrated the on-premises databases to Azure SQL MI -* You have successfully loggeg in via SSMS to Azure SQL MI +* You have successfully logged in via SSMS to Azure SQL MI ## Learning resources * [SQL Server to Azure SQL Managed Instance: Migration guide - Azure SQL Managed Instance](https://learn.microsoft.com/en-us/azure/azure-sql/migration-guides/managed-instance/sql-server-to-managed-instance-guide?view=azuresql) diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-02.md b/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-02.md index 799d5f292..c0b82a2bf 100644 --- a/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-02.md +++ b/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-02.md @@ -11,12 +11,14 @@ The goal of this exercise is to understand monitoring and perfomance optimzation * Identifying performance issues, their root causes and fixing the problem * Use the Azure Portal to identify performance bottlenecks * Using Log Analytics with KQL to visualize Azure SQL MI and database stats +* Use Github Copilot to identify and mitigate performance issues on your Azure SQL MI ## Success criteria * You have identifed the most consuming stored procedure based on the total_worker_time (CPU) * You successfully reviewed the performance graph showing CPU utilization in the Azure Portal * You have successfully queried the AzureDiagnostics using KQL to receive the different diagnostics +* You have successfully leveraged Github Copilot to identify and mitigate the most important performance issues on your Azure SQL MI ## Learning resources * [Monitor Azure SQL Managed Instance - Azure SQL Managed Instance](https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/monitoring-sql-managed-instance-azure-monitor?view=azuresql) diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-03.md b/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-03.md index fb9e43cc3..2c7a11af3 100644 --- a/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-03.md +++ b/03-Azure/01-02 Data/02-SQL_Modernization/challenges/challenge-03.md @@ -11,12 +11,14 @@ The goal of this exercise is to understand the layered security model available * Perform data discovery & classification as a built-in capability for discovering, classifying, labelling and protecting sensitive data in databases * Review the Azure Defender for SQL – Vulnerability Assessment * Azure Defender for SQL – Advanced Threat Protection +* Use Github Copilot to identify and mitigate security issues on your Azure SQL MI ## Success criteria * You have successfully created data classification recommendations and added custom data classification * You successfully used Vulnerability Assessment to generate the initial vulnerability scan baseline * You have successfully reviewed Advanced Threat Protection and created a security alerts on an anomalous activity. +* You have successfully leveraged Github Copilot to identify and mitigate the most important security issues on your Azure SQL MI ## Learning resources * [Security Overview - Azure SQL Database & Azure SQL Managed Instance & Azure Synapse Analytics](https://learn.microsoft.com/en-us/azure/azure-sql/database/security-overview?view=azuresql) diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/challenges/finish.md b/03-Azure/01-02 Data/02-SQL_Modernization/challenges/finish.md index 0bc2c6130..b68a2e995 100644 --- a/03-Azure/01-02 Data/02-SQL_Modernization/challenges/finish.md +++ b/03-Azure/01-02 Data/02-SQL_Modernization/challenges/finish.md @@ -4,7 +4,7 @@ ## Congratulations -You finished the MicroHack *SQL modernization*. +You finished the MicroHack *Smart Modernization : SQL + AI in Action*. If you want to give feedback please dont hesitate to open an Issue on the repository or get in touch with one of us directly. Thank you for investing the time and see you next time! diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-01/solution-01.md b/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-01/solution-01.md index 36a724eed..ad47070f4 100644 --- a/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-01/solution-01.md +++ b/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-01/solution-01.md @@ -1,8 +1,8 @@ -# Walkthrough Challenge 1 - Assessment and migration with Azure Data Studio +# Walkthrough Challenge 1 - Assessment and migration with SQL Server Management Studio (SSMS) **[Home](../../Readme.md)** - [Next Challenge Solution](../challenge-02/solution-02.md) -## Assessment and migration with Azure Data Studio +## Assessment and migration with SQL Server Management Studio (SSMS) ### Contents @@ -10,112 +10,123 @@ [Generic Migration Content](#generic-migration-content) -[1. Get the SQL Managed Instance FQDN](#get-the-sql-managed-instance-fqdn) +[1. Connect to your Win11 VM](#connect-to-your-win11-vm) -[2. Assess the application databases for Azure SQL Database suitability using the Database Migration Assistant](#assess-the-application-databases-for-azure-sql-database-suitability-using-the-database-migration-assistant) +[2. Assess the application databases for Azure SQL suitability using the SQL Server Management Studio (SSMS)](#assess-the-application-databases-for-azure-sql-suitability-using-the-sql-server-management-studio-ssms) -[3. Migrate the application databases to Azure SQL Database managed instance using the Azure Data Studio (ADS) with migration extension and identify target Azure SQL SKU](#migrate-the-application-databases-to-azure-sql-database-managed-instance-using-the-azure-data-studio-ads-with-migration-extension-and-identify-target-azure-sql-sku) +[3. Migrate the application databases to Azure SQL Managed Instance using SQL Server Management Studio (SSMS)](#migrate-the-application-databases-to-azure-sql-managed-instance-using-sql-server-management-studio-ssms) [4. Confirm application databases have been migrated to Azure SQL Managed Instance](#confirm-application-databases-have-been-migrated-to-azure-sql-managed-instance) +[5. Optional: Leverage Github Copilot to remove migration blockers](#optional-leverage-github-copilot-to-remove-migration-blockers) + # Migration architecture and Azure components -![generated](../../Images/MigrationArchitecture.png) +![generated](../../Images/MigrationArchitecturev2.png) # Generic Migration Content | **Narrative** | **Notes** | |:-----|:-------| -| *Notes for outside of the workshop:* *Familiarise yourself with Microsoft migration tools and the Azure Database Migration Guide* | Azure Database Migration Guide: [https://www.microsoft.com/en-us/download/default.aspx](https://azure.microsoft.com/en-gb/services/database-migration/) DMA & download link: Azure Data Studio and Migration Extension download Links: [Download and install Azure Data Studio - Azure Data Studio \| Microsoft Learn](https://learn.microsoft.com/en-us/sql/azure-data-studio/download-azure-data-studio?view=sql-server-ver16&tabs=redhat-install%2Credhat-uninstall) [Azure SQL migration extension for Azure Data Studio - Azure Data Studio \| Microsoft Learn](https://learn.microsoft.com/en-us/sql/azure-data-studio/extensions/azure-sql-migration-extension?view=sql-server-ver16) Microsoft Migration Portal: [https://datamigration.microsoft.com/](https://www.microsoft.com/en-us/download/default.aspx) Identify the right Azure SQL Database, Azure SQL Managed Instance or SQL Server on Azure VM SKU for your on-premises database | +| *Notes for outside of the workshop:* *Familiarise yourself with the new Microsoft migration capabilities with SQL Server Management Studio and Migration options by using Arc* | Migrate SQL Server to Azure SQL (SSMS): [https://learn.microsoft.com/en-us/ssms/migrate/migrate-sql-server-azure-sql?tabs=sql-standard](https://learn.microsoft.com/en-us/ssms/migrate/migrate-sql-server-azure-sql?tabs=sql-standard) This article covers the migration from Arc-Enabled SQL Server instances and Non Arc-Enabled SQL Server instances. For Non Arc-Enabled SQL Server instances there will be no performance-based sizing recommendation. | + +# Connect to your Win11 VM +|**Narrative**| **Screenshot**| **Notes**| +|:------------|:--------------|:---------| +|The instructors will share URLs to connect to your Win11 VM. Credentials will be provided during the Hack.|![Bastion Logon](<../../Images/Bastion-VM11.png>)| | -# Get the SQL Managed Instance FQDN -In this section we'll connect to the Azure Portal and retrieve SQL MI information: FQDN. |**Narrative**| **Screenshot**| **Notes**| |:------------|:--------------|:---------| -| On your Win10 VM open Edge browser and got to: [**HTTPS://portal.azure.com**](HTTPS://portal.azure.com) **Username and Password:** *(see your Teams Group)* In the Azure portal, open the **SQLHACK-SHARED** **Resource Group** and locate the **SQL managed instance** and open it. **Note the Host Name (FQDN)** sqlhackmi-xxxxx.xxxxxxx.database.windows.net. All other **details from the "DB Migration Lab and Parameters.pdf"** | ![](../../Images/d414d816749bacbe40707d20930a6da5.png)| | +| On the Win11 VM you will find a shortcurt for SQL Server Management Studio (SSMS) and a readme.txt that comtains the information about the lab environment | ![Shortcuts](<../../Images/shortcuts.png>) -# Assess the application databases for Azure SQL Database suitability using the Database Migration Assistant +# Assess the application databases for Azure SQL suitability using the SQL Server Management Studio (SSMS) -In this section we will use the Data Migration Assistant (DMA) to assess the applications database for suitability for migration to Azure Cloud. +In this section we will use the SQL Server Management Studio to assess the SQL Server instance databases for suitability for migration to Azure Cloud. |**Narrative**| **Screenshot**| **Notes**| |:------------|:--------------|:---------| -|We need to determine the suitability of the database(s) for migration to Azure. This includes checking for compatibility and feature support with Azure Database. You should already have a remote (Bastion) session open to your teams Win10 Management VM**,** if so run DMA from the Start menus or Desktop icon.|![A screen shot of a computer Description automatically generated](../../Images/3967dd1b4dd31f5c19623f51ce94d486.png)|Database Migration Assistant (DMA) is a free download from Microsoft. It can be used to assess a number of database migration & upgrade scenarios not just SQL Server to Azure SQL Database.| -|You should see this screenshot to the right. Select the **"+"** to create a new **assessment** project|![](../../Images/e2b4706b838049af733fed665f6ada16.png)| -|Select/Enter the following details: **Project name:** **Workshop1**
**Assessment type:** **Database Engine**
**Source server type:** **SQL Server**
**Target server type:** **Azure SQL Database**
Click **'Create'**|![](../../Images/f562a7f4e609509f7032a192b15447d3.png)| Our first project assessment assumes we will be migrating to Azure SQL DB, so the options shown in the screenshot need to be selected.| -|Select the assessment checks (Report Type) to be made:
**Check database compatibility**
**Check feature parity**
Click **'Next'**|![](../../Images/fec55ffa6e1278f1c5e336de2b67c7ff.png) | DMA can test for both database compatibility and feature parity compliance against the Azure target. As this is the initial evaluation, we are assessing a database(s) we will perform all of these tests.| -|Enter the source/legacy SQL details:
**Server Name:** **LEGACYSQL2012**
**Authentication Type:** **SQL Server Authentication**
**Username:** **_Will be provided during hack_**
**Password:** **_Will be provided during hack_**
**Untick "Encrypt connection"**
Click **'Connect'**
*If you get an error logging in check that the Win10 keyboard language.|![A screenshot of a login box Description automatically generated](../../Images/b2f7457ed4a46050afcd18073d4cd96c.png)|When performing this within your own subscription you will enter the host, authentication and connection types according to your company guidelines and practices. *Bear in mind that DMA needs to connect to a source SQL Server using an account that belongs to the* **sysadmin** *role.* As this document is produced within a workshop environment Active Directory, Certificates and encryption has not been setup.| -|Select **only** the 3 databases used by your 'Online Transaction Monitor' app. These will have a **TEAMxx** prefix where XX should be replaced by your team number.
**TEAMxx_LocalMasterDataDb**
**TEAMxx_SharedMasterDb**
**TEAMxx_TenantDataDb**.
Click **'Add'** to add them to the assessment. | ![](../../Images/9488ec94afd6312aa62f3d0855683c83.png)|DMA will show all databases located on the Source host and display them so you can decide which ones to include in this assessment project. **Note**: you can assess multiple databases at the same time. -| You should now see the screen on the right with the relevant TEAMxx databases listed. Select '**Start Assessment'**|![](../../Images/ace5ff77e60d0379b3856db4497d306b.png)|**Note**: DMA allows you to either 'Add' or 'Remove' additional data sources as needed at this point. Also note that DMA provides some high-level metadata about the databases including their compatibility level the total size of each database. [Using Data Migration Assistant to assess an application's data access layer](https://techcommunity.microsoft.com/t5/microsoft-data-migration/using-data-migration-assistant-to-assess-an-application-s-data/ba-p/990430) | -| DMA will now show the results of the assessment using 2 separate reports:
**'SQL Server feature parity'** which is a server level report highlighting any server settings or components (e.g. MSDTC) that the source DBs are using that isn't supported on the target – in this case Azure SQL Database. In our assessment there are 'Unsupported" or "Partially Supported" features reported (**CLR**, **cross database queries, several trace flags**).

**'Compatibility Issues'** which is a database level report detailing individual objects that have compatibility issues. Select **TEAMxx_TenantDataDb** Note the 'Migration blockers' and 'Breaking Changes' including CLR which the database uses. CLR is not supported on Azure SQL DB but is supported by Azure SQL Database Managed Instance (SQLMI).|![](../../Images/b9132f0c444aff5c9af7d4ebe165c543.png)![](../../Images/70795f03ccd50ba39f7aafef5e5d2808.png)|**Note**: Toggle the parity and compatibility issues radio button (top left) to switch between the 2 reports. 'SQL Server feature parity' shows what features are not supported in the target data source. Under the 'Details' and 'Databases' sections on the right you will find remedial action that are required and the databases impacted. 'Compatibility Issues' shows, over the compatibility tabs, issues that need to be addressed to permit the database(s) to run, in the chosen compatibility level (e.g. 160, 150, 140, 130, 120, 110, 100). If you have multiple databases, as with the example screenshot, you need to highlight EACH database to see the compatibility issues.| -|| **Because we need to migrate CLR Stored Procs, we need to repeat the assessment with Azure SQL DB Managed Instance as the target to see if it's compatible**|| -|Once you've reviewed the assessment click the back arrow to see a list of current DMA projects. You should see this screenshot to the right. Select the **"+"** to create a new **assessment** project.|![](../../Images/26f6da81414339b45fd763f27b58c84f.png)|| -|Select/Enter the following details:
**Project name:** **Workshop2**
**Assessment type:** **Database Engine**
**Source server type:** **SQL Server**
**Target server type:** **Azure SQL Database Managed Instance**
Click **'Create'** | ![](../../Images/3b368b382479a605d9cc34179ebc7459.png)| Our 2nd assessment project assumes we will be migrating to Azure SQL DB Managed Instance, so the options shown in the screenshot need to be selected.| -|Select the assessment checks (Report Type) to be made: **Check database compatibility** **Check feature parity**
Click **'Next'** | ![](../../Images/1b111d1094432ba5dca382cc10bd4a8b.png)|As we saw previously DMA can test for both database compatibility and feature parity compliance against the chosen target. As before we will assess all the databases against all of the tests.| -| Enter the source/legacy SQL details:
**Server Name:** **LEGACYSQL2012**
**Authentication Type:** **SQL Server Authentication**
**Username:** **_Will be provided during hack_**
**Password:** **_Will be provided during hack_**
**Untick "Encrypt connection"**
Click **'Connect'**|![A screenshot of a login box Description automatically generated](../../Images/b2f7457ed4a46050afcd18073d4cd96c.png) | When performing this within your own subscription you will enter the host, authentication and connection types according to your company guidelines and practices. *Bear in mind that DMA needs to connect to a source SQL Server using an account that belongs to the sysadmin role.* As this document is produced within a workshop environment Active Directory, Certificates and encryption has not been setup.| -| You should now see the screen on the right with the relevant TEAMXX databases listed. Select '**Start Assessment'** | ![](../../Images/ec0d16f58c29f404b13f9204a9c691e4.png) | **Note**: DMA allows you to either 'Add' or 'Remove' additional data sources as needed at this point. Also note that DMA has identified what compatibility level each source database is running under.| -| As before DMA will now show the results from the assessment as the separate 2 reports. Note the '**SQL Server feature parity**' report will either be clean The '**Compatibility Issues**' report should be clear for all 3 databases showing that they can be migrated to Azure SQLDB Managed Instance without changes.|![](../../Images/6d2872ff60eb0f2926900c12e81c352b.png) | Note: Toggle the parity and compatibility Issues radio button (top left) to see how DMA. 'SQL Server feature parity' shows what features are not supported in the target data source. Under 'Details' and 'Databases' you will find remedial action that are required and the databases impacted. 'Compatibility Issues' shows, over the compatibility tabs, issues that need to be addressed to permit the database(s) to run, in the chosen compatibility level (e.g. 160, 150,140, 130, 120, 110,100). If you have multiple databases, as with the example screenshot, you need to highlight **EACH** database to see the compatibility issues. | +|We need to determine the suitability of the database(s) for migration to Azure. This includes checking for compatibility and feature support with Azure Database. You should already have a remote (Bastion) session open to your teams Win11 Management VM**,** if so run SSMS from the Start menus or Desktop icon.|![SQL Server Management Studio](<../../Images/SSMS start menu.png>)|SQL Server Management Studio (SSMS) is a free download from Microsoft. Since SSMS 22.5 it supports the assessment and migration of SQL Server databases to Azure SQL.| +|Connect to legacySQL2016 by using Wndows Authentivation. Please check the Trust Server Certifcate checkbox||| +|From the context menu of the SQL Server instance select Migrate SQL Server|![Migrate SQL Server](../../Images/Migrate%20SQL%20Server.png)|If the context menu is not visible the Hybrid and Migration workload was not installed with SSMS | +|This opens the main screen for the migration experience|![Migrate SQL Server](../../Images/Migrate%20Screen.png)|| +|Click **Run Readiness Assessment**|![](../../Images/Run%20Readiness%20Assessment.png)|The assessment will take some seconds to minutes depending on the number of databases and the amount of database objects.| +|After the assessment completes we will see that only SQL Server on Azure Virtual Machine will be available as possible migration target|![](../../Images/AssessmentResult01.png)||| +|Click on **View Details** to examine why the migration to Azure SQL Managed Instance will not work for your team databases.||| +|On the detail view you can see which objects are not ready for migration|![](../../Images/AssessmentResultDetails01.png)|| +|Select the **Compatibility Finindings**. This will show why the instance cannot be migrated to Azure SQL Managed Instance|![](../../Images/AssessmentResultDetails02.png)|**Note**: This problem seems to be solvable.| +|Remove the second ldf file. **Hint**: If the database is in Full Recovery Model it might be easier to put the database into Simple Recovery Model, remove the ldf file, and finally turn the database back into Full Recovery Model.||| +|After you removed the migration blocker run the assessment again. Azure SQL Managed Instance should now be a possible migration target without any compatibility blocker.|![](../../Images/AssessmentResult02.png)|| **We are now ready to migrate the application databases to Azure SQL Database Managed Instance** -# Migrate the application databases to Azure SQL Database managed instance using the Azure Data Studio (ADS) with migration extension and identify target Azure SQL SKU +# Migrate the application databases to Azure SQL Managed Instance using SQL Server Management Studio (SSMS) -In this section we will use the Azure Data Studio (ADS) to assess the applications database for suitability for migration to Azure Cloud. +In this section we will use SQL Server Management Studio (SSMS) to migrate the application databases to Azure SQL Managed Instance by using Managed Instance Link. |**Narrative**| **Screenshot**| **Notes**| |:------------|:--------------|:---------| -|We need to determine the suitability of the database(s) for migration to Azure. This includes checking for compatibility and feature support with Azure Database. You should already have an RDP (or Bastion) session open to your teams Win10 Management VM, if so run Azure Data Studio (ADS) from the Start menus or Desktop icon.|![](../../Images/b75f90f39b5b822bc14d18ae2ffb8621.png)| Azure Data Studio (ADS) is a free download from Microsoft. It can be used to perform database administration as well as assess a number of database migration & upgrade scenarios not just SQL Server to Azure SQL Database. [Download and install Azure Data Studio](https://learn.microsoft.com/en-us/sql/azure-data-studio/download-azure-data-studio?view=sql-server-ver16&tabs=redhat-install%2Credhat-uninstall)| -|Select "extensions" icon on the bottom left ( or press : CTRL + Shift + X) and search for: "**Azure SQL migration**" in the extension market and click Install. (If extension is not compatible with the ADS version installed, upgrade ADS under Help \> Check for Updates).|![](../../Images/a12dd92f76c6242ff3ff60b275ead646.png)| See also: [Azure SQL migration extension for Azure Data Studio](https://learn.microsoft.com/en-us/sql/azure-data-studio/extensions/azure-sql-migration-extension?view=sql-server-ver16) | -|Open your browser and navigate to Login in with the credential provided Select the Azure Storage Account "sqlhack…" in the Resource Group: "SQLHACK-SHARED" And click: Access Keys on the left.|![](../../Images/4ea143728ad4a3ec730760572f785d2e.png)| You can note the Key to the notepad and reuse it in following steps. | -|Create database backup in SSMS: Open SQL Server Management Studio (SSMS) on your Team VM. |![](../../Images/286fb2e6d1d6b23789b3d3d16af409f5.png) | | -|In SSMS connect to: **legacysql2012**
Use the credentials:
**User**: **_Will be provided during hack_**
**Password**: **_Will be provided during hack_**|![](../../Images/25bce50ae5aedc9358b1c09cddbdd9e5.png)|| -|**DO NOT EXECUTE THIS STEP** This is for reference only, as only a single credential is required! In SSMS open new query and create the credential using the following script: *USE [master]* *GO* *CREATE CREDENTIAL [Azurebackupstorage] WITH IDENTITY = '\'* *,SECRET = '\'*|![](../../Images/289bd8ec4d83a70c8290893a42e7c2a3.png)| _**This should be only done only by the trainer.**_| -|Backup your team databases: Select your 3 team databases and create a full back to URL for each database
**TEAMXX_TenantDataDB** **TEAMXX_LocalMasterDataDB**
**TEAMXX_SharedMasterDataDB**|![](../../Images/47cdd668bd3f86a4d89336bd93c8eea7.png)| This is the wizard experience in SSMS, you can also take backups using T-SQL scripts. There are some samples below, for this. | -|Backup database: Select Backup to URL Select the credential "Azurebackupstorage" Make sure you enter the Azure container name as follows: **migration/team\_\** e.g. for team01 **migration\\team01_localmasterdatadb**. Repeat this process for the remaining 2 databases: **TEAMXX_LocalMasterDataDB** **TEAMXX_SharedMasterDataDB** Use SSMS like above or use TSQL commands in the right hand side.|![](../../Images/c8e2b67d79caf6a59890bee57dba263d.png)![](../../Images/50d6aabc1ac11857c2a5ff2f7d6961fb.png) | [**You can also directly use TSQL to BackUp your Databases**](#t-sql-backup-code) | -|Switch to Azure portal on your web browser. Review and check that the **full backup** exists in each folder in the Azure Storage account.| *![](../../Images/bc48ffffb341a8f7288bab66aa51c224.png)*|| -|In Azure Data Studio on your Team VM Connect to legacy SQL Server 2012 using "**New Connection**" | ![](../../Images/d20118abebd0f983cb4c31db10098012.png)|| -| Enter server name and credentials.
Connection string: legacysql2012
**User**: **_Will be provided during hack_**
**Password**: **_Will be provided during hack_**.
Click Connect |![](../../Images/e606818baf281ade6ac7bc84885c904a.png)|| -| Right Click on the SQL Server instance on the left hand side and select "**Manage**".|![](../../Images/7accfb1944733173f52473afe3a4bf06.png)|| -| Select Azure SQL migration and choose "**New migration**" |![](../../Images/5791f84a179b493d2325f7fef83571c0.png)|| -|Select your team databases:
**TEAMXX_TenantDataDB**
**TEAMXX_LocalMasterDataDB**
**TEAMXX_SharedMasterDataDB**
Click Next |![](../../Images/0090bffa2e9bab5fce9ab882913500c0.png)|| -|Run assessment and receive recommendation Select Azure SQL target: **Azure SQL managed instance** Select "**Get Azure Recommendation**" Select the Log path: **C:\\Logs** and start the Performance Collection (If "C:\\Logs" folder doesn't exist, create this folder). You will see that data collection is in progress. Stop the performance collection **after \~10 min** by clicking on "Stop Data Collection" and review the recommended configuration which has now automatically appeared on the upper side.|![](../../Images/f224cdfd145b933329a09589fce83717.png)![](../../Images/86725ae84d4d19a6a6aab6652c018fe7.png)![](../../Images/df840e717b23bd5d951fca011db0e0ba.png)![](../../Images/66e97c5183db9f232356cf2a4900e054.png)![](../../Images/735183829e72b24d22d8de7544fac0fc.png)|| -|Review the details of the recommended configuration in that you click on "View Details" under Azure SQL Managed Instance Tab.|![](../../Images/fd722fca02ec3892686fef5a13273d01.png) | Please note that you can also save the recommendation report| -|Click on View/Select and select the 3 team databases for migration:
**TEAMXX_TenantDataDB**
**TEAMXX_LocalMasterDataDB**
**TEAMXX_SharedMasterDataDB**
Click Next|![](../../Images/62bdf7248a303255111fe2dccf27a63b.png)![](../../Images/a2c33df0563053cfc72e190908168372.png)![](../../Images/b9c6e7783ef5e123c08e2d0c85215430.png)|| -|Select Azure Target (SQL MI). For this, you need to add your account that you use to login to Azure Portal: sqlhackuser**XX**@M365x59576877.onmicrosoft.com \&sqlhack@demo\_**XX**!|![](../../Images/5630199a66cc115b379d7a46b1fe34b4.png)|| -| Select the Azure subscription, the Location, Resource Group and Azure SQL MI FDQN Name which are automatically provided from your Account. Click Next.|![](../../Images/552e04b9711d318cca4b9b26e1f33664.png)|| -|Step 4: Select database migration service Select "**offline migration**" Select the existing Azure Database Migration Service: **sqlhack-dmsV2**|![](../../Images/df0f6c23d4f68e630d11ee175b1fb414.png)| You can also do an Online Migration for mission critical workloads using DMS. There are additional steps that you should take for this. Please use the information in the following tutorial for Online Migration:[Tutorial: Migrate SQL Server to Azure SQL Managed Instance online by using Azure Data Studio - Azure Database Migration Service \| Microsoft Learn](https://learn.microsoft.com/en-us/azure/dms/tutorial-sql-server-managed-instance-online-ads) (You can also create a new Database Migration Service within minutes of you do the exercise in your own subscription. For this you can click on "create new in Step 6")| -|In the data source configuration select the last full backup file and click Next | ![](../../Images/6ccfcae25882df567a7b51dcba3ecac5.png)|| -| Review summary and start migration.|![](../../Images/ecdb9fede863af06e2ca346a80af669e.png)|| -| Review progress in Azure Data Studio Click on Refresh from time to time to check the latest status of the migration until it succeeds.|![](../../Images/4a12363cf88d0a17e353598df4caee28.png)![](../../Images/9f8c3cb1370893365f91d97b69a8dc55.png)![](../../Images/2991c3b319d8b486cf78d26782d3f740.png)|| +|On the central migration experience in SSMS you can now select **Migrate Data** and selecting the option **Managed Instance Link** .|![](../../Images/Migrate_with_MI_Link.png)| **Note**: Managed Instance Link offers the option for a migration with minimal downtime. You create the Managed Instance Link first. Then you wait until the databases are synchronized. And finally you do the cut-over.| +|On the first screen of the Managed Instance Link Wizard please provide your team name to better distinguish between the migration objects|![](../../Images/MILink-Wizard01.png)|| +|The Managed Instance Link will check for MI Link readiness of the instance|![](../../Images/MILink-Wizard02.png)|**Note**: The mentioned Trace Flags will make sure that the migration performance is good enough during the migration. The requirements and limitation for Managed Instance Link are listed here [https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/managed-instance-link-feature-overview?view=azuresql#limitations](https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/managed-instance-link-feature-overview?view=azuresql#limitations).| +|Select only the databases of your team. The databases can only be connected to one MI Link|![](../../Images/MILink-Wizard03.png)|| +|Next add the SQL Server Managed Instance as a secondary replica.|![](../../Images/MILink-Wizard04.png)|| +|You need to connect to Azure to select the SQL Managed Instance resource. In addition you need to connect to the Managed Instance itself.|![](../../Images/MILink-Wizard05.png)|**Note**; The credentials are being provided during the Hack.| +|The Wizard connects to the Managed Instance and checks the Managed Instance for compatibility. Click **Next** |![](../../Images/MILink-Wizard06.png)|| +|You will receive a final summary and an option to generate a script. Click **Finish** |![](../../Images/MILink-Wizard07.png)|| +|The wizard creates MI Links for all selected databases.|![](../../Images/MILink-Wizard08.png)|**Note**: This process can take a long time if many databases are involved.| +|The databasee are connected to MI Link.|![](../../Images/MILink-Wizard09.png)|| +|After the Link was established wait until the databases are synchronized.|![](../../Images/check_MILink_Sync.png)|| +|You will see multiple availability groups for every databases. This is notmal.|![](../../Images/MILink_AG_View.png)|| +|For the cut-over stop the application connectivity to the legacy SQL Server and do the failover.||| +|For every database of your team use the context menu on the source legacy SQL Server and select **Azure SQL Managed Instance Link**->**Failover...**.|![](../../Images/MILink_Failover.png)|| +|The Managed Instance Link Failover Wizard will check all prerequisites.|![](../../Images/MILink_Failover_Wizard01.png)|| +|If the database is healthy we can only do a Planned Manuel Failover. Click **Next**.|![](../../Images/MILink_Failover_Wizard02.png)|| +|We have to sign in to Azure and to the Managed Instance again. Click **Next**.|![](../../Images/MILink_Failover_Wizard03.png)|| +|The Wizard checks the readiness for the failover. All looks good. Click **Next**.|![](../../Images/MILink_Failover_Wizard04.png)|| +|Please aknowledge that you should stop application connectivity against the source database and select that the wizard will remove the distributed availability group.|![](../../Images/MILink_Failover_Wizard05.png)|**Note**: After this step you will have two writable copies of the databases on the legacy server and on the Managed Instance.| +|Click **Next**.|![](../../Images/MILink_Failover_Wizard06.png)|| +|You will see a final summary and have the last option to generate a script. Click **Finish**.|![](../../Images/MILink_Failover_Wizard07.png)|| +|The Failover was successful.|![](../../Images/MILink_Failover_Wizard08.png)|| +|The database is no longer member of the distributed availability group.|![](../../Images/DB_RemovedFrom_AG.png)|| + # Confirm application databases have been migrated to Azure SQL Managed Instance +# Optional: Leverage Github Copilot to remove migration blockers + +In this section we will leverage Github Cpoliot to mitigate migration blockers for databases from SQL Server to SQL Azure Managed Instance. + +|**Narrative**| **Screenshot**| **Notes**| +|:------------|:--------------|:---------| +|Connect to Github.|![](../../Images/Connect_Github.png)|**Note**: The credentials are provided during the Hack.| +|A browser window open where you can enter your credentials|![](../../Images/Github_Login.png)|| +|Connect your account with Visual Studio. Click **Continue**.|![](../../Images/Github_Continue.png)|| +|Authorize Visual Studio to connect with Github. Click **authorize github**|![](../../Images/Github_Authorize.png)|| +|Allow the website to open SQL Server Management Studio|![](../../Images/Allow_to_open_SSMS.png)|| +|Github is now connected with SSMS. You can now use the chat function|![](../../Images/SSMS_Github_Chat.png)|| +|Use a prompt similar to the following: *The migration assessment tells me that I cannot migrate to Managed Instance. Can you give me instructions how I will be able to migrate to MI? "C:\Users\DemoUser\AppData\Local\Microsoft\SqlAssessment\SqlAssessment-LegacySQL2016-202608121317html"* |![](../../Images/Github_Prompt_Challenge01.png)|| +|Github requests access to the provided assessment report. Please approve access.|![](../../Images/Github_Approve_Access_to_assessment_report.png)|**Note**: The access requests could occur several times.| +|Github identified the blocker and generates commands to mitigate the blocker.|![](../../Images/Github_Identifies_Blocker01.png)|| +||![](../../Images/Github_Identifies_Blocker02.png)|| +||![](../../Images/Github_Identifies_Blocker03.png)|| +|You can copy over the commands to query window to remove the migration block.|![](../../Images/Github_Identifies_Blocker04.png)|| + + # Annotations -### T-SQL Backup Code +### T-SQL script to check distributed AG status ``` SQL -BACKUP DATABASE [TEAM01_LocalMasterDataDB] -TO URL = N'https://].blob.core.windows.net/migration/team01_localmasterdatadb/TEAM01_LocalMasterDataDB.bak' -WITH CREDENTIAL = N'Azurebackupstorage', -NOFORMAT, NOINIT, -NAME = N'TEAM01_LocalMasterDataDB-Full Database Backup', -NOSKIP, NOREWIND, NOUNLOAD, STATS = 10 -GO - -BACKUP DATABASE [TEAM01_SharedMasterDataDB] -TO URL = N'https://.blob.core.windows.net/migration/team01_shareddatadb/TEAM01_SharedMasterDataDB.bak' -WITH CREDENTIAL = N'Azurebackupstorage', -NOFORMAT, NOINIT, -NAME = N'TEAM01_SharedMasterDataDB-Full Database Backup', -NOSKIP, NOREWIND, NOUNLOAD, STATS = 10 -GO - -BACKUP DATABASE [TEAM01_TenantDataDB] TO URL = N'https://.blob.core.windows.net/migration/team01_tenantdatadb/TEAM01_TenantDataDB.bak' -WITH CREDENTIAL = N'Azurebackupstorage', -NOFORMAT, NOINIT, -NAME = N'TEAM01_TenantDataDB-Full Database Backup', -NOSKIP, NOREWIND, NOUNLOAD, STATS = 10 -GO +SELECT + DB_NAME(drs.database_id) AS DatabaseName, + drs.synchronization_state_desc, + drs.synchronization_health_desc, + drs.is_commit_participant, + drs.log_send_queue_size, + drs.redo_queue_size, + drs.last_commit_time +FROM sys.dm_hadr_database_replica_states drs +WHERE DB_NAME(drs.database_id) LIKE 'TEAM01%' +ORDER BY DatabaseName; ```` \ No newline at end of file diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-02/solution-02.md b/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-02/solution-02.md index 6100cb412..829bd9382 100644 --- a/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-02/solution-02.md +++ b/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-02/solution-02.md @@ -19,9 +19,11 @@ [3. Using Log Analytics with KQL to visualize SQL MI and Database Stats](#using-log-analytics-with-kql-to-visualize-sql-mi-and-database-stats) +[4. Optional: Using Github Copilot to solve performance issues](#optional-using-github-copilot-to-solve-performance-issues) + # Migration architecture and Azure components -![generated](../../Images/MigrationArchitecture.png) +![generated](../../Images/MigrationArchitecturev2.png) # Lab Overview & Background @@ -29,12 +31,12 @@ In this exercise you will explore how you can monitor and diagnose performance i ## Background -We have seen that the legacy application is a multi-tenant system with a collection of 3 databases supporting the transactional workload for each customer – these are the 3 databases we have modernised by migrating to the shared Azure SQL Managed Instance. +We have seen that the legacy application is a multi-tenant system with a collection of 4 databases supporting the transactional workload for each customer – these are the 4 databases we have modernised by migrating to the shared Azure SQL Managed Instance. Apart from the tenant centric transactional databases there are 2 shared databases: --**2008DW**: A centralised Data Warehouse database that combines data from the various tenant transactional databases and is used for aggregated reporting and analytics. --**TenantCRM**: A centralised database that is used to manage all customer relationships and order processing. +* **SharedMasterDataDB**: A centralised Data Warehouse database that combines data from the various tenant transactional databases and is used for aggregated reporting and analytics. +* **TenantCRM**: A centralised database that is used to manage all customer relationships and order processing. Recently you have heard complaints from users that the TenantCRM system is running slowly. Recently changes were made to some of the stored procedures in the TenantCRM database and the App dev team believe these are the source of the problem. They’ve asked for your help to track down the performance issues and its root cause. @@ -54,16 +56,14 @@ Finding the bottleneck will help us determine what category issue we have so we |**Narrative/Instructions**| **Screenshot**| **Notes**| |:------------|:--------------|:---------| -|On your Win10 Team VM open the Azure Portal and navigate to the shared SQL Managed Instance. Scroll down the Overview screen copy the host name of the Managed Instance and save it somewhere handy.| **![](../Images/b85b4bea1fe0cd9a9677a5bb04c4576b.png)**|| -|On your Team Win10 VM open **Azure Data Studio** and **Add Connection** using these details:
**Server:** \
**Authentication: SQL Login** **Login:** **_Will be provided during hack_**
**Password:** **_Will be provided during hack_**| **![](../Images/5da1cbcecc9015df01046aea7173a475.png)** **![](../Images/bc3ec5c2da045111ae301a2983266246.png)** || -|**Open** the SQL script: C:\\_SQLHACK_\\LABS\\02-Administering_Monitoring\\Part_01_Monitoring_Lab_1.sql

**Note:** Make sure you connect with the **TenantCRM** database.

Run the **PART 1** QUERY 1. Look at the results and note the [avg_cpu_percent] value is about 70% indicating that this database is consuming a lot of the hosts CPU resources|![](../Images/f813232846539c9b2785ea44f8883e94.png)| [[sys].[dm_db_resource_stats]](https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-resource-stats-azure-sql-database?view=azuresqldb-current) exposes a number of key database performance metrics. One metric every 15 seconds over the last hour.| -|Now let’s try the second query to graphically visualize the resource consumption.
**Execute** QUERY 2 and on the results, activate the **Chart view**![](../Images/3ba431565b1c4c240af8e09de1bb3f7d.png)On the RightSettings ![](../Images/0a409ed83e0cbbdb5056b2d52c17e3eb.png)|![](../Images/41eb87096bb54768a65b7d21bafebe9a.png) | If more than 1 hour of statistics is needed, use the DMV [[sys].[server_resource_stats]](https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-resource-stats-azure-sql-database?view=azuresqldb-current) up to 14 days| -|**Open** SQL Server Management Studio using the same details:
**Server name:** SQL MI
**Authentication: SQL Server**
**Login:** **_Will be provided during hack_**
**Password:** **_Will be provided during hack_**| **![](../Images/4b05bbceae6c4c0d2c4e37e53e60dfd4.png)**|| -|**Open** the SQL script: C:\\_SQLHACK_\\LABS\\02-Administering_Monitoring\\Part_02_Monitoring_Lab_1.sql

**Note:** Make sure you connect with the **TenantCRM** database.

**Run** the **PART 2** QUERY 1.
Identify the most consuming stored procedure based on the total_worker_time (CPU)|![](../Images/ad69a5f2a781f8c634d6522000027a1a.png)|| +|On your Team Win11 VM open **SQL Server Management Studio (SSMS)** and connect to the Azure SQL Managed Instance using these details from the readme.txt file. **Authentication: SQL Login** **Login:** **_Will be provided during hack_**
**Password:** **_Will be provided during hack_**| **![](../../Images/4b05bbceae6c4c0d2c4e37e53e60dfd4.png)**|| +|**Open** the SQL script: C:\\MicroHack\\LABS\\02-Administering_Monitoring\\Part_01_Monitoring_Lab_1.sql

**Note:** Make sure you connect with the **TenantCRM** database.

Run the **PART 1** QUERY 1. Look at the results and note the [avg_cpu_percent] value is spiking many times indicating that this database is consuming a lot of the hosts CPU resources|![](../../Images/f813232846539c9b2785ea44f8883e94.png)| [[sys].[dm_db_resource_stats]](https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-resource-stats-azure-sql-database?view=azuresqldb-current) exposes a number of key database performance metrics. One metric every 15 seconds over the last hour.| +|Now let’s try the second query to analyze the resource consumption.
**Execute** QUERY 2 and analyze the values during the last minutes. You will see spikes in CPU consumption.|| If more than 1 hour of statistics is needed, use the DMV [[sys].[server_resource_stats]](https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-resource-stats-azure-sql-database?view=azuresqldb-current) up to 14 days| +|**Open** the SQL script: C:\\MicroHack\\LABS\\02-Administering_Monitoring\\Part_02_Monitoring_Lab_1.sql

**Note:** Make sure you connect with the **TenantCRM** database.

**Run** the **PART 2** QUERY 1.
Identify the most consuming stored procedure based on the total_worker_time (CPU)|![](../../Images/ad69a5f2a781f8c634d6522000027a1a.png)|| |Then to have further details on the most consuming stored procedure **Run** the **PART 2** QUERY 2, replace the filter clause with the stored procedure name. What is the issue? How to optimise? **Tip:** Have a look to the execution plan| **CROSS APPLY and Table-valued Functions**
The PART 2 query joins the [sys].[dm_exec_requests] and [sys].[dm_exec_sql_text] DMVs to obtain long running batches and critically their offending SQL. Note that [dm_exec_sql_text] is actually a table-valued function (TVF) hence the use of the CROSS APPLY as TVFs can't be used in a normal join operation. The CROSS APPLY therefore produces the required inner-join between [dm_exec_requests] and [dm_exec_sql_text].
See APPLY documentation here: [Using APPLY \| Microsoft Docs](https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms175156(v=sql.105)?redirectedfrom=MSDN) and this excellent explanation on MSSQLTips: [SQL Server CROSS APPLY and OUTER APPLY (mssqltips.com)](https://www.mssqltips.com/sqlservertip/1958/sql-server-cross-apply-and-outer-apply/#:~:text=The%20CROSS%20APPLY%20operator%20returns%20only%20those%20rows,rows%20for%20the%20left%20table%20expression%20match%20only.)|| -| In SSMS expand the [TenantCRM] database then expand Query Store.Remember that the Query Store collects telemetry data every 15 seconds and persists it for about 1hr. Double click on **Overall Resource Consumption** report to open it.| ![](../Images/7e23b421dd7ec737ca5a61692ed7d03d.png)|| -| For further details CPU Time, double click on the current day bar| ![](../Images/3d128986226374d9cc0b8afeff0bb6e6.png)| -| You can identify the top CPU consuming queries. Click on bars for more details| ![](../Images/954f6dfa708564bef81ec0f46ee77bd7.png) || +| In SSMS expand the [TenantCRM] database then expand Query Store.Remember that the Query Store collects telemetry data every 15 seconds and persists it for about 1hr. Double click on **Overall Resource Consumption** report to open it.| ![](../../Images/7e23b421dd7ec737ca5a61692ed7d03d.png)|| +| For further details CPU Time, double click on the current day bar| ![](../../Images/3d128986226374d9cc0b8afeff0bb6e6.png)| +| You can identify the top CPU consuming queries. Click on bars for more details| ![](../../Images/954f6dfa708564bef81ec0f46ee77bd7.png) || ## Using the Azure Portal to identify performance bottlenecks @@ -89,3 +89,16 @@ Now that we can use the global monitoring tool Log Analytics to identify which S |On the results for each of the queries, change the to **Chart**

![](../../Images/dea1e46afaecbef9b0005c3e95b20144.png)
The chart Formatting is on the right.| // more specific queries
//Query get CPU usage
AzureDiagnostics
\| where Resource == "SQLHACKMI-WORWEGR7VULCU" and TimeGenerated \> ago(2h) //replace with your SQL MI Instance Name
\| where Category == "ResourceUsageStats"
\| project TimeGenerated, todecimal(avg_cpu_percent_s)
// visualize the resulset as a chart ![](../../Images/dc5f8134b938a54b4b3f00262894ec55.png)

// Query get database Waits Stats
AzureDiagnostics
\| where Category == "QueryStoreWaitStatistics"
\| summarize Total_Wait_Ms = max(todouble(total_query_wait_time_ms_d)) by wait_category_s, DatabaseName_s
\| order by Total_Wait_Ms desc

// visualize the resulset as a chart
![](../../Images/4dd51a5f1f7285ddafeb49aa9cad6d44.png)|| We’ve now seen how the various performance monitoring and diagnosis tools – the Azure Portal, DMVs and the Query Store reports all revealed that the CPU was under pressure. The DMVs and Query Store reports also allowed us to drill-down to root cause and identify the worst offending query. In the real world you would now progress to tune the offending query to reduce the overall load on the Managed Instances CPUs and thereby improve the databases and environment performance. + +## Optional: Using Github Copilot to solve performance issues + +In this exercise you will leverage Github Copilot to identify performance issues and try mitigate those. + +|**Narrative/Instructions**| **Screenshot**| **Notes**| +|:------------|:--------------|:---------| +|On your Team Win11 VM open **SQL Server Management Studio (SSMS)** and connect to the Azure SQL Managed Instance using these details from the readme.txt file. **Authentication: SQL Login** **Login:** **_Will be provided during hack_**
**Password:** **_Will be provided during hack_**| **![](../../Images/4b05bbceae6c4c0d2c4e37e53e60dfd4.png)**|| +|Enter a prompt similar to the following to the Github Copilot Chat window *Please check for queries or stored procedures with the highest load in the TenantCRM database and suggest solutions for possible performance issues.*|![](../../Images/GithubCopilot_performance_prompt.png)|| +|Github Copilot may request several times approval to execute queries to analyze the problem. Please approve the requests.|![](../../Images/GithubCopilot_Approve.png)|| +|Github Copilot identified the missing index and suggests to create the index. You can insert the **INDEX CREATE** script and execute it in the query window.|![](../../Images/GithubCopilot_MissingIndex.png)|| + +We have seen how Github Copilot can help us analyze and mitigate performance issues. diff --git a/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-03/solution-03.md b/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-03/solution-03.md index 86fc60669..fbc94d9bd 100644 --- a/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-03/solution-03.md +++ b/03-Azure/01-02 Data/02-SQL_Modernization/walkthrough/challenge-03/solution-03.md @@ -24,6 +24,8 @@ [Advanced Threat Protection](#advanced-threat-protection) +[**6.** Use Github Copilot to identify security issues in your database](#use-github-copilot-to-identify-security-issues-in-your-database) + # # **Introduction** @@ -45,7 +47,7 @@ So this lab will focus on the Threat Protection, Information Protection and Cust All the labs run against the **TEAMXX_TenantDataDb** that you migrated earlier using either SQL Server Management Studio or the Azure Portal. -Your Win10 VM (vm-TEAMXX) login credentials are also a member of SQL Server sysadmin role. +Your Win11 VM (vm-TEAMXX) login credentials are also a member of SQL Server sysadmin role. **Username:** _Will be provided during hack_ **Password:** _Will be provided during hack_ @@ -128,9 +130,22 @@ More information in Azure Defender for SQL – Advanced Threat Protection can be |Scroll down the Overview screen until you see the list of databases and click on your **TEAMXX_TenantDataDB** database.||| |In the **TEAMXX_TenantDataDB** database screen, on the left-hand blade click **Microsoft Defender for Cloud** in the Security section Scroll down to the **Security incidents and alters heading** – note no incidents or alerts are listed:| **![](../../Images/eec68b37bb4694ee925c4cc6f5c34938.png)**|| |On the team VM, open a new query window in SQL Server Management Studio connected to your **TEAMXX_TenantDataDB** database.||| -|To simulate a potential SQL injection query copy the following SELECT into the new query window **BUT DON’T RUN IT YET**:|--Advanced Threat Protection
SELECT \*
FROM sys.databases
WHERE database_id like '' or 1 = 1 -- ' and family = 'test1';|Notice that the logic in the WHERE clause will always equate to true and the positioning of single-quotes including in the comment represents a potential SQL injection vulnerability| +|To simulate a potential SQL injection query copy the following SELECT into the new query window **BUT DON’T RUN IT YET**:|--Advanced Threat Protection
DECLARE @UserInput nvarchar(max) = ''' OR 1=1--';
DECLARE @SQL nvarchar(max) = 'SELECT * FROM sys.databases WHERE name = ''' + @UserInput + '''';
EXEC(@SQL);
|Notice that the logic in the WHERE clause will always equate to true and the positioning of single-quotes including in the comment represents a potential SQL injection vulnerability| |Before running the query change the connection properties as show opposite using the **Query\\Connection\\Change Connection**… menu in SSMS.

Click **Connect**| Specify the name of the team Azure SQL Database: **TEAMXX_TenantDataDB** ![Graphical user interface, application Description automatically generated](../../Images/82b9ed825ade0d643bc7758660735c06.png)
On “Additional Connection Parameters add a connection string option to specify the application name: **Application Name=webappname**
![](../../Images/1684cc725d25a813222954105a73f264.png) | |Run the query.

It will return a list of databases on the server.|| |Back in the Azure Portal **Microsoft Defender for Cloud** screen, after a few minutes an Alert should be generated:

**NOTE:** It might take up to 10mins for the alert to appear in the portal| ![Graphical user interface Description automatically generated with low confidence](../../Images/a181cd65084cdd5f3515875e20bea999.png)| |Once the Later appears click on it to see the details.

Depending on the progress of other teams you may see multiple entries in the details table.|![A screenshot of a computer Description automatically generated](../../Images/619ec45260df07ebfec33d52e66706f2.png)| |Try clicking on the Alert.

Note that you can drill further into the alert to see more details, get explanations and links to documentation on the alert and even advice on how negate and remediate the problem.|| + +## Use Github Copilot to identify security issues in your database + +In this exercise you will leverage Github Copilot to identify security issues and try mitigate those. + +|**Narrative/Instructions**| **Screenshot**| **Notes**| +|:------------|:--------------|:---------| +|On your Team Win11 VM open **SQL Server Management Studio (SSMS)** and connect to the Azure SQL Managed Instance using these details from the readme.txt file. **Authentication: SQL Login** **Login:** **_Will be provided during hack_**
**Password:** **_Will be provided during hack_**| **![](../../Images/4b05bbceae6c4c0d2c4e37e53e60dfd4.png)**|| +|Enter a prompt similar to the following to the Github Copilot Chat window *Please check for security issues and options to mitigate them in the TenantCRM database.*|![](../../Images/GithubCopilot_performance_prompt.png)|| +|Github Copilot may request several times approval to execute queries to analyze the problem. Please approve the requests.|![](../../Images/GithubCopilot_Approve.png)|| +|Github Copilot identified the stored procedure AdminExecuteSQLCommand to be vulnerable to SQL Code Injections. Copilot recommends to use sp_executesql for proper parameter handling.|![](../../Images/GithubCopilot_SqlInjectionProc.png)|| + +We have seen how Github Copilot can help us analyze and mitigate security issues.