Gijs Reijn shows how to automate the process of creating an Azure SQL Database using Powershell:
Before you can create an Azure SQL database, you must create an Azure SQL server to host it on. Assuming you’re already authenticated to Azure:
Open PowerShell on your local computer and create the Azure SQL server that will host the Azure SQL database.
The command below is creating an Azure SQL server called
sqlestate
in the prerequisite resource group with a SQL admin username ofSqlAdministrator
and a password ofAVeryStrongP@ssword0
. The command is saving the output of theNew-AzSqlServer
cmdlet to use attributes from the server created later.
Read on for the step-by-step breakdown and full script.