1

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 1

1

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

enter image description here

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

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you Joy Wang, this is very helpful, I'll definitely try that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.