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
sqlestatein the prerequisite resource group with a SQL admin username of
SqlAdministratorand a password of
AVeryStrongP@ssword0. The command is saving the output of the
New-AzSqlServercmdlet to use attributes from the server created later.
Read on for the step-by-step breakdown and full script.