Azure SQL using Powershell
- Launch Powershell from your laptop
- Prereq’s: Windows 10
- Install
Install-Module -Name Az -AllowClobber
- Login into Azure:
Connect-AzAccount
- Launch CloudShell if you are not in suitable environment
Finding the Right Commands (cmdlets) in Powershell
- In Powershell we have
- Cmd-lets:
- Commands of Powershell organized in <verb>-<noun> for eg:
Get-PS, New-Item,
- Finding a Right cmdlet is simple
Get-Command <pattern> # and find the right cmdlet or change the pattern Get-Help <cmd-let> -Online
- Commands of Powershell organized in <verb>-<noun> for eg:
- Cmd-lets:
- Azure Powershell is installed on the Machine as Powershell Module Az, all the cmdlets of Azure Powershell will be in the form of <verb>-Az<noun> for eg:
Get-AzGroup, New-AzVm
Scenario: Create an Azure SQL Server
- Create a Resource Group
Get-Command *-AzResource*
Get-Help New-AzResourceGroup -Online
- Script Changes:
$resg = New-AzResourceGroup -Name sqlserverfromps -Location centralus
3. Create an SQL Server
Get-Command *-AzSQL*
Get-Help New-AzSqlServer -Online
- Exercise: Try to write the complete script to create Azure SQL Database and try to acheive all the things as mentioned over here
Azure SQL For Other Databases
- Azure also provides managed services for
- mySQL
- Postgres
- We need to understand the features provider for SQL Server and other managed databases.
- Exercise:
- Ensure you have one Azure SQL Server Created
- Ensure you have one Azure mySQL Server Created Refer Here or Create Azure Postgresql from here
Next Topics
- Features Provided by Azure to
- SQL Server
- mySQL
- Postgres
- Synapse Analytics and then how about Oracle?
- SQL Server Instance
- Cache Databases