Quickstart: Create a Hyperscale database in Azure SQL Database

In this quickstart, you create a logical server in Azure and a Hyperscale database in Azure SQL Database using the Azure portal, a PowerShell script, or an Azure CLI script, with the option to create one or more High Availability (HA) replicas. If you would like to use an existing logical server in Azure, you can also create a Hyperscale database using Transact-SQL.

Prerequisites

Create a Hyperscale database

This quickstart creates a single database in the Hyperscale service tier.

To create a single database in the Azure portal, this quickstart starts at the Azure SQL page.

  1. Browse to the Select SQL Deployment option page.

  2. Under SQL databases, leave Resource type set to Single database, and select Create.

    Screenshot of the Azure SQL page in the Azure portal. The page offers the ability to select a deployment option including creating SQL databases, SQL managed instances, and SQL virtual machines.

  3. On the Basics tab of the Create SQL Database form, under Project details, select the desired Azure Subscription.

  4. For Resource group, select Create new, enter myResourceGroup, and select OK.

  5. For Database name, enter mySampleDatabase.

  6. For Server, select Create new, and fill out the New server form with the following values:

    • Server name: Enter mysqlserver, and add some characters for uniqueness. We can't provide an exact server name to use because server names must be globally unique for all servers in Azure, not just unique within a subscription. Enter a name such as mysqlserver12345, and the portal will let you know if it's available.
    • Server admin login: Enter azureuser.
    • Password: Enter a password that meets requirements, and enter it again in the Confirm password field.
    • Location: Select a location from the dropdown list.

    Select OK.

  7. Under Compute + storage, select Configure database.

  8. This quickstart creates a Hyperscale database. For Service tier, select Hyperscale.

    Screenshot of the service and compute tier configuration page for a new database in Azure SQL Database. The Hyperscale service tier has been selected.

  9. Under Compute Hardware, select Change configuration. Review the available hardware configurations and select the most appropriate configuration for your database. For this example, we will select the Standard-series (Gen5) configuration.

  10. Select OK to confirm the hardware generation.

  11. Under Save money, review if you qualify to use Azure Hybrid Benefit for this database. If so, select Yes and then confirm you have the required license.

  12. Optionally, adjust the vCores slider if you would like to increase the number of vCores for your database. For this example, we will select 2 vCores.

  13. Adjust the High-Availability Secondary Replicas slider to create one High Availability (HA) replica.

  14. Select Apply.

  15. Carefully consider the configuration option for Backup storage redundancy when creating a Hyperscale database. Storage redundancy can only be specified during the database creation process for Hyperscale databases. You may choose locally redundant (preview), zone-redundant (preview), or geo-redundant storage. The selected storage redundancy option will be used for the lifetime of the database for both data storage redundancy and backup storage redundancy. Existing databases can migrate to different storage redundancy using database copy or point in time restore.

    Screenshot of the basics tab in the create database process after the Hyperscale service tier has been selected and configured.

  16. Select Next: Networking at the bottom of the page.

  17. On the Networking tab, for Connectivity method, select Public endpoint.

  18. For Firewall rules, set Add current client IP address to Yes. Leave Allow Azure services and resources to access this server set to No.

  19. Select Next: Security at the bottom of the page.

    Screenshot of the networking configuration page for a new database in Azure SQL Database that enables you to configure endpoints and optionally add a firewall rule for your client IP address.

  20. Optionally, enable Microsoft Defender for SQL.

  21. Select Next: Additional settings at the bottom of the page.

  22. On the Additional settings tab, in the Data source section, for Use existing data, select Sample. This creates an AdventureWorksLT sample database so there's some tables and data to query and experiment with, as opposed to an empty blank database.

  23. Select Review + create at the bottom of the page:

    Screenshot of the 'Additional Settings' screen to create a database in Azure SQL Database allows you to select sample data.

  24. On the Review + create page, after reviewing, select Create.

Query the database

Once your database is created, you can use the Query editor (preview) in the Azure portal to connect to the database and query data. If you prefer, you can alternately query the database by connecting with Azure Data Studio, SQL Server Management Studio (SSMS), or the client of your choice to run Transact-SQL commands (sqlcmd, etc.).

  1. In the portal, search for and select SQL databases, and then select your database from the list.

  2. On the page for your database, select Query editor (preview) in the left menu.

  3. Enter your server admin login information, and select OK.

    Screenshot of the Query editor (preview) pane in Azure SQL Database gives two options for authentication. In this example, we have filled in Login and Password under SQL server authentication.

  4. If you created your Hyperscale database from the AdventureWorksLT sample database, enter the following query in the Query editor pane.

    SELECT TOP 20 pc.Name as CategoryName, p.name as ProductName
    FROM SalesLT.ProductCategory pc
    JOIN SalesLT.Product p
          ON pc.productcategoryid = p.productcategoryid;
    

    If you created an empty database using the Transact-SQL sample code, enter another example query in the Query editor pane, such as the following:

    CREATE TABLE dbo.TestTable(
        TestTableID int IDENTITY(1,1) NOT NULL,
        TestTime datetime NOT NULL,
        TestMessage nvarchar(4000) NOT NULL,
     CONSTRAINT PK_TestTable_TestTableID PRIMARY KEY CLUSTERED (TestTableID ASC)
    ) 
    GO
    
    ALTER TABLE dbo.TestTable ADD CONSTRAINT DF_TestTable_TestTime  DEFAULT (getdate()) FOR TestTime
    GO
    
    INSERT dbo.TestTable (TestMessage)
    VALUES (N'This is a test');
    GO
    
    SELECT TestTableID, TestTime, TestMessage
    FROM dbo.TestTable;
    GO
    
  5. Select Run, and then review the query results in the Results pane.

    Screenshot of the Query editor (preview) pane in Azure SQL Database after a query has been run against AdventureWorks sample data.

  6. Close the Query editor page, and select OK when prompted to discard your unsaved edits.

Clean up resources

Keep the resource group, server, and single database to go on to the next steps, and learn how to connect and query your database with different methods.

When you're finished using these resources, you can delete the resource group you created, which will also delete the server and single database within it.

To delete myResourceGroup and all its resources using the Azure portal:

  1. In the portal, search for and select Resource groups, and then select myResourceGroup from the list.
  2. On the resource group page, select Delete resource group.
  3. Under Type the resource group name, enter myResourceGroup, and then select Delete.

Next steps

Connect and query your database using different tools and languages:

Learn more about Hyperscale databases in the following articles: