Skip to content

Set-ElasticPool

Azure: Updates an Azure SQL Elastic Pool

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

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

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

	[Parameter(Mandatory = $false)]
	[string]$Edition,

	[Parameter(Mandatory = $false)]
	[int]$Dtu
)

try {
	Import-Module Az.Sql -ErrorAction Stop
	
	[hashtable]$cmdArgs = @{ 
		'ResourceGroupName' = $ResourceGroupName; 
		'ServerName' = $ServerName; 
		'ElasticPoolName' = $ElasticPoolName;
		'ErrorAction' = 'Stop' 
	}
	if ($Edition) { $cmdArgs.Add('Edition', $Edition) }
	if ($Dtu) { $cmdArgs.Add('Dtu', $Dtu) }

	$pool = Set-AzSqlElasticPool @cmdArgs
	Write-Output $pool
} 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 update.

The edition of the pool (e.g. Basic, Standard, Premium).

The DTU limit for the pool.

An interactive directory of PowerShell scripts.