Exercise - Deploy Azure SQL Database

Completed

In this activity, you'll deploy Azure SQL Database by using the Azure portal. Throughout this exercise, you'll also explore the options that are available to you.

Deploy Azure SQL Database by using the Azure portal

  1. Sign in to the Azure portal by using the same account that you activated the sandbox with.

  2. In the top search bar, enter Azure SQL and wait for results so you can review what appears.

    There are a lot of items and categories here, but basically this menu gives you filters for what you can search on. Let's break them down:

    • Services: If you select this, you can see your existing resources (that is, already deployed) all together. For example, if you selected Azure SQL, you would see all of your SQL virtual machines, databases, logical servers, managed instances, and pools.
    • Resources: This searches based on existing resource names. For example, if you searched for "adventureworks," any resources with "adventureworks" in the name would be returned here.
    • Marketplace: This allows you to deploy new resources from Azure Marketplace.
    • Documentation: This searches learn.microsoft.com for relevant documentation.
    • Resource groups: This allows you to search based on resource group name.
  3. Select Azure SQL under Marketplace. This step will bring you to the Azure SQL create experience.

    Screenshot of the Azure SQL deployment options in the portal.

  4. In SQL databases, select Single database > Create.

  5. On the Basics tab, enter the following information:

    Parameter Value
    Subscription Concierge subscription
    Resource group Sandbox resource group name
    Database name AdventureWorks
    Server Select Create new, fill out the Server details pane as follows, and select OK:
    Server name: Enter a unique name for the server (for example, aw-server0406).
    Location: Use a region that's close to you.
    Authentication method: Use SQL authentication.
    Server admin login: cloudadmin
    Password/Confirm Password: Use a complex password that meets strong password requirements. Note this password for later use.
    Want to use SQL elastic pool? No
    Compute + storage Leave the default of General Purpose, Gen5, 2 vCores, 32 GB storage
    Backup storage redundancy Leave the default of Geo-redundant backup storage
  6. Select Next: Networking.

  7. For Connectivity method, select Public endpoint. Select Yes for both Allow Azure services and resources to access this server and Add current client IP address.

  8. For Connection policy, select Default.

  9. Select Next: Security.

  10. When you deploy Azure SQL Database in the portal, you're prompted about whether you want to Enable Microsoft Defender for SQL in a free trial. Select Start free trial.

    After the free trial, it's billed according to the Microsoft Defender for Cloud Standard Tier pricing. After you enable it, you get functionality related to identifying/mitigating potential database vulnerabilities and threat detection.

  11. Leave remaining defaults and select Next: Additional settings.

  12. On the Additional settings tab, for Azure SQL Database you have the option to select the AdventureWorksLT database as the sample in the Azure portal. For this exercise, for Use existing data, select Sample.

  13. Select Review + create. Here, you can review your deployment selections and the Azure Marketplace terms. Review all the options to ensure that all of your selections match the exercise instructions, and then select Create to deploy the service.

  14. You're redirected to a pane where you can monitor the status of your deployment. You can also go to your resource group and select Deployments to open this same pane. It gives you the various deployments, their status, and more information. This deployment typically takes less than five minutes to deploy.

    Screenshot of resources being deployed.

  15. When your deployment is complete, select Go to resource.

    Screenshot that shows deployment is complete.

  16. Review the Overview pane for the SQL database in the Azure portal and confirm that the status is Online.

Connect to Azure SQL Database

Next, let's look at the basics of connecting to your deployed SQL database and compare that experience to connecting to SQL Server.

What does connecting to SQL Server 2019 look like?

Before you look at the SQL database that you just deployed, let's review what connecting to an instance of SQL Server 2019 might look like. Typically, you'd open SQL Server Management Studio (SSMS) and connect to the local instance of SQL Server 2019. You might use Windows Authentication for the connection. The selections would be similar to the following image.

Screenshot that shows how to connect to SQL Server 2019 in SSMS.

You'd then see a view that looks similar to the following.

Screenshot of what a SQL Server 2019 deployment looks like in SSMS.

Keep that in mind as a reference for comparison as you complete the following steps.

Connect to your SQL Database by using SSMS

  1. First, we need the logical server name. On the Overview pane for your database, locate the Server name information. This will be the fully qualified domain name (FQDN) of your logical server, for example, aw-server0406.database.windows.net. Hover your mouse at the end of the name and select Copy to clipboard.

  2. Let's connect to your Azure SQL Database logical server. On your local device, open SSMS if it's not open already, and create a new connection. Select Connect > Database Engine.

    Screenshot of how to connect to Azure SQL Database in SSMS.

  3. For Server name, paste the name of your Azure SQL Database logical server.

    Change the authentication to SQL Server Authentication. Then enter the corresponding server admin login and password (the one you provided during deployment in the previous exercise).

    Select Remember password, and then select Connect.

    Note

    Depending on your local configuration (for example, VPN), your client IP address might differ from the IP address that the Azure portal used during deployment. If it does, you'll get a pop-up message that says "Your client IP address does not have access to the server. Sign in to an Azure account and create a new firewall rule to enable access." If you get this message, sign in with the account you're using for the sandbox, and add a firewall rule for your client IP address. You can complete all of these steps by using the pop-up wizard in SSMS.

  4. Expanding the databases and system databases should result in a view similar to the following.

    Screenshot of the view of SQL Database folders in SSMS.

    Spend a few minutes exploring the differences, at first glance, between the Azure SQL Database logical server and SQL Server. You won't deploy a managed instance as part of this exercise, but the following image shows how a managed instance would appear in SSMS.

    Screenshot of the view of a managed instance in SSMS.

In this exercise, you saw how to deploy and connect to Azure SQL Database, and how it compares (at first glance) to SQL Server and Azure SQL Managed Instance. In the next exercise, you'll continue this comparison, going deeper and exploring various methods to verify your deployment/installation.