Migrate to Innovate Summit:
Learn how migrating and modernizing to Azure can boost your business's performance, resilience, and security, enabling you to fully embrace AI.Register now
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Creating a single database is the quickest and simplest option for creating a database in Azure SQL Database. This quickstart shows you how to create a single database using an Azure Resource Manager template (ARM template).
An ARM template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for your project. The template uses declarative syntax. In declarative syntax, you describe your intended deployment without writing the sequence of programming commands to create the deployment.
If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to Azure button. The template will open in the Azure portal.
To create databases via Transact-SQL: CREATE DATABASE permissions are necessary. To create a database a login must be either the server admin login (created when the Azure SQL Database logical server was provisioned), the Microsoft Entra admin of the server, a member of the dbmanager database role in master. For more information, see CREATE DATABASE.
To create databases via the Azure portal, PowerShell, Azure CLI, or REST API: Azure RBAC permissions are needed, specifically the Contributor, SQL DB Contributor, or SQL Server Contributor Azure RBAC role. For more information, see Azure RBAC built-in roles.
Review the template
A single database has a defined set of compute, memory, IO, and storage resources using one of two purchasing models. When you create a single database, you also define a server to manage it and place it within Azure resource group in a specified region.
Select Try it from the following PowerShell code block to open Azure Cloud Shell.
Azure PowerShell
$projectName = Read-Host -Prompt"Enter a project name that is used for generating resource names"$location = Read-Host -Prompt"Enter an Azure location (i.e. centralus)"$adminUser = Read-Host -Prompt"Enter the SQL server administrator username"$adminPassword = Read-Host -Prompt"Enter the SQL Server administrator password" -AsSecureString$resourceGroupName = "${projectName}rg"New-AzResourceGroup -Name$resourceGroupName -Location$locationNew-AzResourceGroupDeployment -ResourceGroupName$resourceGroupName -TemplateUri"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.sql/sql-database/azuredeploy.json" -administratorLogin$adminUser -administratorLoginPassword$adminPasswordRead-Host -Prompt"Press [ENTER] to continue ..."
Keep this resource group, server, and single database if you want. You can now connect and query your database using different methods.
Create a server-level firewall rule to connect to the single database from on-premises or remote tools. For more information, see Create a server-level firewall rule.
After you create a server-level firewall rule, connect and query your database using several different tools and languages:
Find out what makes Azure SQL Database a good choice for your relational database, how to create the database from the portal and connect with Azure Cloud Shell.
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.
Learn about creating and managing servers and single databases in Azure SQL Database using the Azure portal, PowerShell, the Azure CLI, Transact-SQL (T-SQL), and Rest-API.