Provisioning and connecting to an Azure SQL database using PowerShell
In this recipe, we’ll learn how to create and connect to an Azure SQL database instance. Azure SQL Database comes in three flavors: standalone Azure SQL Database, Azure SQL Database elastic pools, and managed instances. In this recipe, we’ll create a standalone Azure SQL database.
Getting ready
In a new PowerShell window, execute the Connect-AzAccount
command to log in to your Microsoft Azure account.
How to do it…
Let’s begin by provisioning an Azure SQL database.
Provisioning an Azure SQL database
Execute the following steps to provision an Azure SQL database:
- Execute the following PowerShell command to create a new resource group:
New-AzResourceGroup -Name packtadesql -Location "eastus"
- Execute the following command to create a new Azure SQL server:
#create credential object for the Azure SQL Server admin credential $sqladminpassword...