Skip to content

Remove-ElasticPool

Azure: Removes an Azure SQL Elastic Pool

param(
	[Parameter(Mandatory = $true)]
	[string]$ResourceGroupName,

	[Parameter(Mandatory = $true)]
	[string]$ServerName,

	[Parameter(Mandatory = $true)]
	[string]$ElasticPoolName
)

try {
	Import-Module Az.Sql -ErrorAction Stop
	Remove-AzSqlElasticPool -ResourceGroupName $ResourceGroupName -ServerName $ServerName -ElasticPoolName $ElasticPoolName -Force -ErrorAction Stop
	Write-Output "Successfully removed Elastic Pool '$ElasticPoolName' from server '$ServerName'."
} catch {
	Write-Error $_
	exit 1
}

The name of the resource group.

The name of the Azure SQL Server.

The name of the Elastic Pool to remove.

An interactive directory of PowerShell scripts.