Create a single database – Azure SQL Database
Create a single database
- Browse to the Select SQL Deployment option page.
- Under SQL databases, leave Resource type set to Single database, and select Create.
- On the Basics tab of the Create SQL Database form, under Project details, select the desired Azure Subscription.
- For Resource group, select Create new, enter myResourceGroup, and select OK.
- For Database name, enter mySampleDatabase.
- 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. So enter something like
mysqlserver12345
, and the portal lets you know if it’s available or not. - Location: Select a location from the dropdown list.
- Authentication method: Select Use SQL authentication.
- Server admin login: Enter azureuser.
- Password: Enter a password that meets requirements, and enter it again in the Confirm password field.
Select OK.
- 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. So enter something like
- Leave Want to use SQL elastic pool set to No.
- Under Compute + storage, select Configure database.
- This quickstart uses a serverless database, so leave Service tier set to General Purpose (Scalable compute and storage options) and set Compute tier to Serverless. Select Apply.
- Under Backup storage redundancy, choose a redundancy option for the storage account where your backups will be saved.
- Select Next: Networking at the bottom of the page.
- On the Networking tab, for Connectivity method, select Public endpoint.
- For Firewall rules, set Add current client IP address to Yes. Leave Allow Azure services and resources to access this server set to No.
- Under Connection policy, choose the Default connection policy, and leave the Minimum TLS version at the default of TLS 1.2.
- Select Next: Security at the bottom of the page.
- On the Security page, you can choose to start a free trial of Microsoft Defender for SQL, as well as configure Ledger, Managed identities and Transparent data encryption (TDE) if you desire. Select Next: Additional settings at the bottom of the page.
- 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. You can also configure database collation and a maintenance window.
- Select Review + create at the bottom of the page:
- On the Review + create page, after reviewing, select Create.
Query the database
- In the portal, search for and select SQL databases, and then select your database from the list.
- On the page for your database, select Query editor (preview) in the left menu.
- Enter your server admin login information, and select OK.
- 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;
- Select Run, and then review the query results in the Results pane.
- Close the Query editor page, and select OK when prompted to discard your unsaved edits.
Tag:Azure