0

I'm working through some automation scripts and attempting to identify Elastic Pools that have been defined, but are empty (no databases).

Using Get-AzSqlElasticPool, I can grab the name of the pool and its associated properties.

Capacity and DatabaseCapacityMax are initially both set to 50 in my lab after it is provisioned. Since there is no property that reflects the current count, my expectation was that I would have to compare Capacity and DatabaseCapacityMax.

To get the info I'm running this command:

Get-AzSqlElasticPool -ResourceGroupName $resourcegroupname -ServerName myServer.ServerName | Select-Object -Property ElasticPoolName, Capacity, DatabaseCapacityMax

I then provisioned databases in the Elastic Pool, none of the capacity properties changed. The documentation on the MSFT docs website seems to be lacking for any of the properties and I've been unable to find anything useful. Am I missing something, has anyone else had any luck determining the number of databases associated with the elastic pool?

root
  • 325
  • 2
  • 11
Mike Oryszak
  • 298
  • 2
  • 10

1 Answers1

0

Information on the databases in the elastic pool, can be found with the Get-AzSqlElasticPoolDatabase command, which has an object that summarizes the number of databases:

Get-AzSqlElasticPoolDatabase -ServerName myServer.ServerName -ResourceGroupName $resourcegroupname -ElasticPoolName $elasticpoolname | Select-Object Count

The number of database is indeed not provided with the Get-AzSqlElasticPool command, because it only provides the static parameters of the Elastic Pool.

As a side-note: Capacity provides the capacity of the whole elastic pool and DatabaseCapacityMax provides the maximum capacity per database.

MarliesV
  • 65
  • 3