I'm trying to get a list of all "Provisioned" (not "Serverless") Azure databases from particular subscription using Powershell. I'm fairly new to ps, so probably I don't see something very obvious. In Set-AzSQLDatabase method there is a parameter -ComputeModel, however, I can not find corresponding parameter or property to filter on for use in Get-AzSQLDatabase. Can it be done in powershell script? Would really appreciate any pointers in the right direction.
1 Answer
There is no ComputeModel property in the result of Get-AzSQLDatabase, the option is to use Get-AzResource.
There is a Kind property in the result of the command, for Provisioned database, it is v12.0,user,vcore, for Serverless database, it is v12.0,user,vcore,serverless, so we can use it to filter the databases in your subscription.
Sample:
Get-AzResource -ResourceType Microsoft.Sql/servers/databases | Where-Object {$_.Kind -eq 'v12.0,user,vcore'} | ft
If you want to get details about the databases, you could use ConvertTo-Json.
Get-AzResource -ResourceType Microsoft.Sql/servers/databases | Where-Object {$_.Kind -eq 'v12.0,user,vcore'} | ConvertTo-Json
1 Comment
Boris Pitel
Thank you Joy Wang, this is very helpful, I'll definitely try that.

