Azure Classroomnotes 23/Dec/2022

Creating Azure SQL using Azure Powershell

  • Steps:

    • Create a resource group
    • Create a sql server and sql database
  • Refer Here for official docs
$resg = New-AzResourceGroup -Name 'fromps' -Location 'eastus'

New-AzSqlServer -ServerName 'qtdbfrompsdec22' -ResourceGroupName $resg.ResourceGroupName `
    -Location $resg.Location -SqlAdministratorCredentials (Get-Credential)
$sqlserver = Get-AzSqlServer -ServerName  'qtdbfrompsdec22' -ResourceGroupName $resg.ResourceGroupName

#todo: Create a firewall

$sqldatabase = New-AzSqlDatabase -DatabaseName 'employees' -Edition Basic `
    -MinimumCapacity 5 -ServerName $sqlserver.ServerName `
    -SampleName AdventureWorksLT -ResourceGroupName $resg.ResourceGroupName

  • Exercise:
  • Create a replication of the database
  • Add firewall
  • Add this database to some elastic pool

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner