Gabriel Oliveira
Gabriel Oliveira

Reputation: 3

Update VCore by database in power shell

best regards!

I've this code in powersheel in Runbook from Azure.

Connect-AzAccount -Identity
Get-AzSubscription



Select-AzSubscription -SubscriptionId "xxxxxxxxxxxxxx"

# Definir variáveis
$resourceGroupName = "XXXXXX" 
$serverName = "XXXXXX" 
$elasticPoolName = "XXXXXX" 
$vCoreCount = 4                     
$edition = "GeneralPurpose"          
$computeGeneration = "Gen5"         
$dtuMax = 4
$dtuMin = 0



echo "Obtendo informações do pool elástico..."
Get-AzSqlElasticPool -ResourceGroupName $resourceGroupName -ServerName $serverName -ElasticPoolName $elasticPoolName



echo "Atualizando as configurações do pool elástico..."
Set-AzSqlElasticPool -ResourceGroupName $resourceGroupName `
                     -ServerName $serverName `
                     -ElasticPoolName $elasticPoolName `
                     -Edition $edition `
                     -ComputeGeneration $computeGeneration `
                     -VCore $vCoreCount `


echo "Atualização concluída. Informações atualizadas do pool elástico:"
Get-AzSqlElasticPool -ResourceGroupName $resourceGroupName -ServerName $serverName -ElasticPoolName $elasticPoolName

This code updates the elastic pool VCore to four vcore elastic pool.

But it doesn't update this part settings by database, how can I update this? What is the parameter, I want to set it to 4 which is the maximum.

I tried with the parameters

But it still continued with 2

I need it to stay this way enter image description here

Upvotes: -1

Views: 42

Answers (1)

Jahnavi
Jahnavi

Reputation: 8018

But it doesn't update this part settings by database, how can I update this?

Firstly, updating the elastic pool vcore cores does not reflect the per database settings vcores in SQL elastic pool. Both are different according to their functionality.

By referring to the Set-Azsqlelasticpool MS Doc, it is mentioned that there is a specific parameter for configuring per database max or min vcores with -DatabaseVCoreMin and -DatabaseVCoreMax. And also, the VCore max per database for the elastic pool should not exceed more than (2.0) cores for service tier General Purpose.

Before configuration, the vcores per database settings in my elastic pool is 0.5 as shown in the below image.

enter image description here

Now, I have modified your script as below with the required parameters, and it was successfully updated the per database cores along with the vcores limit clearly.

Connect-AzAccount -identity
$resourceGroupName = "Jahnavi" 
$serverName = "newserj" 
$elasticPoolName = "vcorepool " 
$vCoreCount = 4                 
$edition = "GeneralPurpose"          
$computeGeneration = "Gen5"
$databasevcoremaxcount = 2         

echo "get elastic pool"
Get-AzSqlElasticPool -ResourceGroupName $resourceGroupName -ServerName $serverName -ElasticPoolName $elasticPoolName
echo "configuring to v4"
Set-AzSqlElasticPool -ResourceGroupName $resourceGroupName `
                     -ServerName $serverName `
                     -ElasticPoolName $elasticPoolName `
                     -Edition $edition `
                     -ComputeGeneration $computeGeneration `
                     -VCore $vCoreCount `
                     -DatabaseVCoreMax $databasevcoremaxcount

echo "After configuration"
Get-AzSqlElasticPool -ResourceGroupName $resourceGroupName -ServerName $serverName -ElasticPoolName $elasticPoolName

enter image description here

enter image description here

enter image description here

enter image description here

Upvotes: 0

Related Questions