diff --git a/cloudsqlworkshop/03_Deploy_SQL_AzureVM/readme.md b/cloudsqlworkshop/03_Deploy_SQL_AzureVM/readme.md index 2258bd1..e5be67e 100644 --- a/cloudsqlworkshop/03_Deploy_SQL_AzureVM/readme.md +++ b/cloudsqlworkshop/03_Deploy_SQL_AzureVM/readme.md @@ -2,7 +2,7 @@ This is a set of exercises to deploy SQL Server on Azure Virtual Machine. The exercises are designed to be completed in a workshop environment with an instructor; however, you can also complete them on your own if you have the necessary Azure subscription and resources. -In these exercises, you will be given a scenario and set of requirements to deploy SQL Server on Azure Virtual. You will learn new skills unique to Azure as well as using your existing SQL Server skills to achieve a successful deployment. +In these exercises, you will be given a scenario and set of requirements to deploy SQL Server on Azure Virtual Machine. You will learn new skills unique to Azure as well as using your existing SQL Server skills to achieve a successful deployment. In these exercises you will: @@ -29,9 +29,9 @@ You must meet the following requirements: - Deploy SQL Server 2022 with Windows Server 2022. You may use any edition of SQL Server including any free edition. - The Azure Virtual machine must support at minimum 4 vCores and 32Gb of RAM and use the **E5-series**. So for example, the **E4ds_v5** VM Size could be a good starting point. You must deploy the virtual machine using the Azure Portal. For the purposes of this exercise, use VM sizes with Intel processors. - The Virtual Machine has these other requirements: - - Create a new resource group of the name of your choosing. **Note: Your instructor may aleady have resource group deployed** + - Create a new resource group of the name of your choosing. **Note: Your instructor may aleady have resource groups deployed** - Choose a VM name of your choosing. - - Choose any region that is supported for your subscription and RBAC permissions. **Note: For instructor led workshops, check with you instructor.** + - Choose any region that is supported for your subscription and RBAC permissions. **Note: For instructor led workshops, check with your instructor.** - The VM has No Infrastructure Redundancy requirements - The VM can use the Standard security type - The VM cannot run with Azure Spot discounts @@ -41,12 +41,12 @@ You must meet the following requirements: - You do have existing Windows Server licenses that you can use for this PoC. - There are no special requirements for the OS disk, Management, Advanced, or Monitoring sections when deploying the VM. - For Networking, choose the default virtual network and subnet that is created for you. You do not need to create a new virtual network or subnet. You need to make sure you use a **Basic** NIC networking security group. - - **Important Notes:** For instructor led labs your instruction may ask you to deploy the Azure Virtual Machine in a *specific virtual network and subnet* that allows it to easily connect to Azure SQL Managed Instance for other modules. + - **Important Notes:** For instructor led labs your instructor may ask you to deploy the Azure Virtual Machine in a *specific virtual network and subnet* that allows it to easily connect to Azure SQL Managed Instance for other modules. - **Users who cannot use RDP** may need to deploy a Bastion service deployed with your virtual network in Azure to connect to the Azure Virtual Machine. For instructions to deploy a Bastion service see https://docs.microsoft.com/azure/bastion/bastion-create-host-portal. For instructor led labs your instructor may provide you with a Bastion service to use. - You do not have to specify any tags for the VM. - The SQL Server instance should be configured as follows: - MAXDOP for the server = # of cores from the VM - - Locked Pages in Memory enabled. + - Lock Pages in Memory enabled. - Instant File Initialization enabled. - All other instance configuration choices can be left to their defaults. @@ -58,19 +58,19 @@ The database, system databases, transaction log, and tempdb must meet the follow - Database files must be stored on a disk other than the OS disk, can use the default drive letter and path from the Azure Portal, and require Premium SSD. Do not store user database data or log files on temporary or ephemeral disks. - The database files only require **512Gb** storage to account for growth. (Note: the database used to verify the scenario is only 1Gb in size but is only used a test). -- I/O performance requirements for database files is **3000 to 4000 IOPS**, and a max of **200Mb throughput**. +- I/O performance requirements for database files is **3000 to 4000 IOPS**, and a max of **200MB throughput**. - System databases (other than tempdb) should be configured to be on the same disk as database files. **Requirements for the transaction log** - Must be stored on a separate disk from database files, can use the default drive letter and path from the Azure Portal, and require Premium SSD. -- The transaction log requires **128Gb** storage, **500 IOPS**, and **100Mb** max throughput. +- The transaction log requires **128GB** storage, **500 IOPS**, and **100MB** max throughput. **Requirements for tempdb** - Tempdb must be stored on the local SSD drive for Azure VM so you must choose an Azure VM size that supports local SSD storage. Tempdb *could grow to 128Gb* in size so the VM size you choose must support that. - Configure the number of tempdb files to match vCores for your chosen VM size. -- Use other best practices to make tempdb data and transaction log files an initial size of 8Mb with autogrow set to 64Mb. +- Use other best practices to make tempdb data and transaction log files an initial size of 8MB with autogrow set to 64MB. You do not need to use any Tags. @@ -82,7 +82,7 @@ In this exercise, you will go through the process of deploying SQL Server on an 2. To help you get started in the Azure Portal type in Azure SQL in the search box and choose **Azure SQL** and then choose **Azure SQL** from the Marketplace section. -3. You should see three choices for Azure SQL. Select the Image dropdown for SQL Virtual Machines. Based on the requirements choose the least expensive option that meets the requirements and click Create. +3. You should see three choices for Azure SQL. Select the Image dropdown for SQL Virtual Machines. Based on the requirements choose the least expensive option that meets the requirements and click Create. You do not need the High Availability option. 1. You are now in a user experience to **Create a virtual machine** with several tabs starting with **Basics**. @@ -117,8 +117,8 @@ The requirements and steps should give you enough information to complete the ex Storage is usually what will be most difficult to configure. Consider the following answers to help you if you get stuck or want to verify your work. -- If you first start with a 512Gb disk you will see that the IOPS and throughput are not enough. You will need to choose a larger disk size. But when you go to 1TB you will see the IOPS and throughput are enough but you will see warnings about the VM size capping IOPS and throughput. -- Change the transaction log to 128Gb. The IOPS and throughput are enough for that disk. +- If you first start with a 512GB disk you will see that the IOPS and throughput are not enough. You will need to choose a larger disk size. But when you go to 1TB you will see the IOPS and throughput are enough but you will see warnings about the VM size capping IOPS and throughput. +- Change the transaction log to 128GB. The IOPS and throughput are enough for that disk. - The warning still exists for the VM size but not for IOPS anymore but for throughput. We need a VM size that supports our throughput requirements for both disks. - So you need to cancel out of this and go back and choose a different VM size. **Note:** If you stayed with this choice you would be capped on IOPS and throughput that is less than what is required. - Our app only needs 4 vCores so we don't want to have to overpay for cores to get the I/O performance we need. So the **E4bds_v5** becomes a new choice that meets all of our requirements but is still cost effective. Change to this VM size then go back to the storage configuration assistant. You will see that there are no more warnings. You now have the storage performance you need for the workload @@ -150,8 +150,10 @@ Use the following steps to connect to the VM with RDP and prepare for the next m 1. When you first connect into the VM you can select No for discovering your device on networks. 1. Inside the virtual machine, download the **tpch.bak** SQL Server backup file and **Source code** zip file from https://aka.ms/cloudsqlworkshopfiles. Move the tpch.bak file into the f:\data folder. 1. *Extract* out the Source code zip file which will put the files into the **``\Downloads\cloudsqlworkshop-1.0-release** folder. -1. From the extracted workshop source files load the **restore_tpch.sql** script from the **``\Downloads\cloudsqlworkshop-1.0-release\cloudsqlworkshop-1.0-release\cloudsqlworkshop\03_Deploy_SQL_AzureVM** folder into SSMS to restore the database. This should only take about 10-15 seconds to restore. You can connect with SSMS using the local server with Windows Authentication as the admin you configured during deployment is automatically setup as a sysadmin SQL Server login. +1. From the extracted workshop source files load the **restore_tpch.sql** script from the **``\Downloads\cloudsqlworkshop-1.0-release\cloudsqlworkshop-1.0-release\cloudsqlworkshop\03_Deploy_SQL_AzureVM** folder into SSMS to restore the database. This should only take about 10-15 seconds to restore. You can connect with SSMS using the local server with Windows Authentication as the admin you configured during deployment is automatically setup as a sysadmin SQL Server login. + +**Note:** The default for SSMS is now Mandatory Encryption so you will need to check the Trust server certificate box when connecting. ## Next Steps -In Module 4, you will perform various steps to verify the deployment meets the requirements of the scenario as defined in this module. You will also learn about how to explore capabilities of the Azure Virtual Machine provided by the SQL Server IaaS Agent extension. \ No newline at end of file +In Module 4, you will perform various steps to verify the deployment meets the requirements of the scenario as defined in this module. You will also learn about how to explore capabilities of the Azure Virtual Machine provided by the SQL Server IaaS Agent extension. diff --git a/cloudsqlworkshop/04_Manage_and_Optimize_SQL_AzureVM/readme.md b/cloudsqlworkshop/04_Manage_and_Optimize_SQL_AzureVM/readme.md index 81b3bd3..1c201f8 100644 --- a/cloudsqlworkshop/04_Manage_and_Optimize_SQL_AzureVM/readme.md +++ b/cloudsqlworkshop/04_Manage_and_Optimize_SQL_AzureVM/readme.md @@ -72,7 +72,7 @@ When you run the workload test to **verify I/O performance**, you should see Dis ## Exercise 4.2 - Explore the SQL IaaS Agent Extension -Use the Azure Portal to review the capabilities of the SQL Server IaaS Agent Extension. You can find the documentation at https://docs.microsoft.com/azure/azure-sql/virtual-machines/windows/sql-vm-resource-provider-overview. +Use the Azure Portal to review the capabilities of the SQL Server IaaS Agent Extension. You can find the documentation at https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/sql-server-iaas-agent-extension-automate-management. 1. Find your virtual machine in the Azure Portal (https://portal.azure.com) as a SQL Server Virtual Machine by searching in the top of the Azure Portal for "SQL Virtual Machines". Select SQL Virtual Machines from the list of Services. 2. Select your virtual machine from the list of SQL Server Virtual Machines. diff --git a/cloudsqlworkshop/06_Manage_and_Optimize_AzureSQLMI/readme.md b/cloudsqlworkshop/06_Manage_and_Optimize_AzureSQLMI/readme.md index 5e08be7..a24e7fb 100644 --- a/cloudsqlworkshop/06_Manage_and_Optimize_AzureSQLMI/readme.md +++ b/cloudsqlworkshop/06_Manage_and_Optimize_AzureSQLMI/readme.md @@ -22,7 +22,7 @@ In this exercise, you will use the Azure Portal (https://portal.azure.com) and A ### Explore your deployment in the Azure Portal 1. Find your Azure SQL Managed Instance in the Azure Portal. You can use the search bar at the top of the Azure Portal to search for the name of your Azure SQL Managed Instance or you can find it in the resource group you deployed it to. -1. Select **November 2022 Feature Wave** from the left-hand menu and review the new innovations that are in the feature wave. +1. Select **Start/Stop Schedule** from the left-hand menu under Settings and review how you can start and stop your instance on-demand or on a schedule. 1. Select **Compute + Storage** from the left-hand menu. Review the various choices you have for service-tiers, Zone Redundancy, Hardware generation, vCores, and storage. 1. Learn how to reduce your cost. **Note: Your instructor may have you skip this section if prices are not shown for an instance that is already deployed. Instead, you can explore the Azure Pricing Calculator at https://azure.microsoft.com/pricing/calculator/ to see the possible cost savings.** 2. Scroll down to view the pricing details at the bottom of the page. Take note of the cost. Scroll back up to SQL Server License and select **Azure Hybrid Benefit (AHB)** and check the "I confirm..." option. Scroll down and see the Cost Savings. @@ -147,7 +147,6 @@ Azure SQL Managed Instance is very compatible with SQL Server. Use this exercise 1. Right-click the *service* and see that the options to Start, Stop, or Restart are greyed out. This is because the service is managed by Azure. 1. Right-click **Databases** and see that the options to Detach or Attach are not available. You don't have access to the filesystem in the underlying virtual machine so don't have access to detach or attach databases. 1. Right-click **Databases** and select Restore Database. Click on "..." next to Device. Select the drop down for the Backup media type and you can see that you can only restore from URL or S3. You don't have access directly to the filesystem of the underlying VM so can only restore from Azure Storage or S3 storage. - 1. Looking at the high-level list of Object Explorer options notice the Always On High Availability option is missing. This is because Always On is built-in and you don't have to configure it. 1. Expand the **Management** folder in Object Explorer. Notice features like Resource Governor, Extended Events, and DTC are there. 1. Right-click on *the database* you created in Exercise 6.2. Select Properties and then Files. Expand out the window. Notice you can modify size and even add or remove files and notice the path which is a local drive within the VM (because Business Critical service tier databases are stored on local SSD drives). Click add to add a new file. Notice you are not allowed to change the path because you don't have access to the underlying filesystem of the VM. diff --git a/cloudsqlworkshop/07_Deploy_Manage_Optimize_AzureSQLDB/readme.md b/cloudsqlworkshop/07_Deploy_Manage_Optimize_AzureSQLDB/readme.md index a8a8634..b53e9bc 100644 --- a/cloudsqlworkshop/07_Deploy_Manage_Optimize_AzureSQLDB/readme.md +++ b/cloudsqlworkshop/07_Deploy_Manage_Optimize_AzureSQLDB/readme.md @@ -9,7 +9,6 @@ In these exercises you will: - Learn how to view the deployment of an Azure SQL Database. - Learn how to explore and configure an Azure SQL Database including Microsoft Entra authentication. - Learn similarities and differences between SQL Server and Azure SQL Database. -- Learn how to connect and use Azure SQL Database with Azure Data Studio. - Learn how to scale an Azure SQL Database using Serverless. - Learn how to explore built-in HADR capabilities of Azure SQL Database. @@ -18,7 +17,7 @@ In these exercises you will: - You must have an Azure subscription with the ability to create an Azure SQL Database using the General Purpose Service Tier. You must have the ability to create an Azure SQL Database in the Azure region of your choice. - You need a client computer to connect and run workloads against Azure SQL Database. You can use your own computer or use an Azure Virtual Machine like the one you deployed in Module 3. If you use an Azure Virtual Machine you will be automatically enabled to connect to Azure SQL Database because of your choices when deploying the Azure SQL Database. If you use your own client computer you will need to enable a firewall setting. This will be described in more detail in the exercise to deploy the Azure SQL Database. - You will need access to the **Source Code** zip file which you can download into your deployed VM from https://aka.ms/cloudsqlworkshopfiles. *Extract* out the Source Code zip file which will put the files into the **``\Downloads\cloudsqlworkshop-1.0-release** folder. You can skip this step if you have already downloaded these files into your VM as part of a previous module. You do not need the tpch.bak file for this module. -- In your client computer you will use **SQL Server Management Studio** (https://aka.ms/ssms). SSMS will also install **Azure Data Studio** (https://aka.ms/azuredatastudio) which you will also use in this module. +- In your client computer you will use **SQL Server Management Studio** (https://aka.ms/ssms). > **Note:** For instructor led workshops you may use the same virtual machine you deployed in Module 3 of this workshop. @@ -103,13 +102,13 @@ Perform the following steps after the deployment completes to perform a basic va 1. On the left-hand menu select **Deployments**. 1. The deployment name should start with "Microsoft.SQLDatabase.newDatabaseNewServer...". If you scroll to the right you can see the Duration of the deployment. This is the time it took to deploy the Azure SQL Logical Server and Database. You can click on the deployment name to see more details about the deployment. -## Exercise 7.3 - Explore and connect to Azure SQL Database +## Exercise 7.3: Explore and connect to Azure SQL Database In this exercise you will explore your Azure SQL Database deployment and perform some basic configuration. ### Explore Azure SQL Database in the Azure Portal -1. If look at the **Essentials** pane In the Azure Portal for you database you can see various properties under Essentials including your resource group, Status, Region (Location), and Subscription. One of the most important properties is Server name. This is the name of the logical server that hosts your database. This is the name of the SQL Server you will use to connect with tools like Azure Data Studio or SSMS. You can also see the Earliest restore point for the database based on automatic backups (which may not be available immediately after you create the database but will be populated in minutes after deployment). +1. If look at the **Essentials** pane In the Azure Portal for you database you can see various properties under Essentials including your resource group, Status, Region (Location), and Subscription. One of the most important properties is Server name. This is the name of the logical server that hosts your database. This is the name of the SQL Server you will use to connect with tools like SSMS. You can also see the Earliest restore point for the database based on automatic backups (which may not be available immediately after you create the database but will be populated in minutes after deployment). 1. Under Essentials you can see options for Getting Started, Monitoring, Properties, Features, Notifications, Integrations, and Tutorials. A very rich set of options for your database. 1. On the left-hand menu, there is an option to open up a **Query Editor** to run queries from the Azure Portal. While you won't use the editor in this module you can learn more at https://learn.microsoft.com/azure/azure-sql/database/query-editor. 1. Under this on the left-hand menu, under **Settings** there are options to change Compute + Storage, view Connection Strings for applications, and change the default Maintenance Window. You will change Compute + Storage in a later exercise but you can click on each of these to explore how to use them. @@ -142,7 +141,7 @@ In this section, you will connect Azure SQL Database and explore more about your SELECT @@VERSION; ``` - You should see results that look similar to the following: + You should see results that look similar to the following (the date/time may new newer): `Microsoft SQL Azure (RTM) - 12.0.2000.8 Sep 18 2023 12:22:37 Copyright (C) 2022 Microsoft Corporation` @@ -165,6 +164,8 @@ In this section, you will connect Azure SQL Database and explore more about your You can do this in SSMS in your current connection, by using the drop-down in the upper left-hand corner and selecting your database. When you do this notice in the bottom right-hand corner of SSMS the connection string changes to include the database name. **Change the context now for the next step**. +### Explore Azure SQL Database through T-SQL + 1. Examine resource limits of your database Try executing the following query: @@ -187,34 +188,7 @@ In this section, you will connect Azure SQL Database and explore more about your INSERT INTO dontdropme VALUES (1); GO ``` - -### Use Azure Data Studio with Azure SQL Database - -Let's use a tool that you may not be as familiar with called Azure Data Studio (ADS) to connect to Azure SQL Database. - -#### Connect with Azure Data Studio - -1. Launch Azure Data Studio. You may get a prompt to update to the latest version. If so, update to the latest version which will take a few minutes to complete. If prompted, select Yes to enabling Preview features. -1. To connect, click on the icon Connections on the left-hand menu and then click on **New Connection**. -1. Fill in the following Connection details: - 1. Connection type: Microsoft SQL Server - 1. Input type: Parameters - 1. Server: The name of your logical server - 1. Authentication type: SQL Login - 1. User name: The SQL admin user name - 1. Password: The SQL admin password. Click Remember password. - 1. Database: The name of your database - 1. Encrypt: Mandatory (True) - 1. Trust Server Certificate: True -1. Click **Connect** - -#### Explore your database with Azure Data Studio (ADS) - -Let's use ADS to explore the database and look at various features to compare and contrast with SQL Server and Azure SQL Database. - -1. Use the Object Explorer interface to browse tables from the sample database AdventureWorksLT. -2. Right-click on the connection and select **New Query**. Use `+<+>` to increase the font size. -3. Execute the following query to view database properties: +1. View database properties with the following query: ```tsql SELECT name, database_id, recovery_model_desc, compatibility_level, is_query_store_on, is_encrypted, is_accelerated_database_recovery_on, is_read_committed_snapshot_on FROM sys.databases; @@ -231,7 +205,7 @@ Let's use ADS to explore the database and look at various features to compare an - **Accelerated Database Recovery** is ON by default and cannot be disabled (This is required for Microsoft to honor SLAs). - **Read Committed Snapshot Isolation** is ON by default. -4. Run the following queries to see common ***Dynamic Management Views (DMV)*** you use in SQL Server are supported: +1. Run the following queries to see common ***Dynamic Management Views (DMV)*** you use in SQL Server are supported: ```tsql SELECT * FROM sys.dm_exec_sessions; @@ -284,15 +258,13 @@ Let's use ADS to explore the database and look at various features to compare an Even with a logical server, the SQL Server instance is managed by Microsoft and you cannot change instance level settings but that is a benefit of having a managed database service. -8. Use SQL Profiler with Azure SQL Database - - **Note:** This extension requires Azure Data Studio version 1.46 later. If you have not updated and restarted Azure Data Studio, do so now. +### Use Extended Events through SSMS - Use the SQL Server Profiler extension of Azure Data Studio to trace queries against your database. Use the following documentation to learn how to install and use the extension: https://learn.microsoft.com/azure-data-studio/extensions/sql-server-profiler-extension. +XEvent Profiler (XEProfiler) provides you similar capabilities as you may have seen in the past with SQL Profiler. XEProfiler allows you to quickly see a live stream of extended events for common events like SQL queries. XEProfiler has been supported for SQL Server and Azure SQL Managed Instance and is now supported for Azure SQL Database. - This extension uses Extended Events to help you trace queries. You can learn more about Extended Events at https://docs.microsoft.com/sql/relational-databases/extended-events/extended-events. +You can access XEProfiler in SSMS off the Object Explorer when connected to the logical server of an Azure SQL Database. - Background events are not shown. You can use Object Explorer to expand and refresh in Azure Data Studio to see some events show up. +Expand the options in Object Explorer for your database and click on XEvent Profiler. Double-click Standard. You will see a new window with a live stream of events. If you wait a few seconds, new events will appear. These are examples of queries used by our infrastructure to monitor and manage your database. ### Configure and connect with Microsoft Entra diff --git a/cloudsqlworkshop/slides/The Cloud Workshop for the SQL Professional.pptx b/cloudsqlworkshop/slides/The Cloud Workshop for the SQL Professional.pptx index ac73499..4c74ca7 100644 Binary files a/cloudsqlworkshop/slides/The Cloud Workshop for the SQL Professional.pptx and b/cloudsqlworkshop/slides/The Cloud Workshop for the SQL Professional.pptx differ