有没有办法在 powershell 脚本中检索 Azure SQL 数据库的计算模型
Is there a way to retrieve compute model of Azure SQL database in powershell script
我正在尝试使用 Powershell 从特定订阅中获取所有“Provisioned”(不是“无服务器”)Azure 数据库的列表。我是 ps 的新手,所以我可能看不到很明显的东西。在 Set-AzSQLDatabase 方法中有一个参数 -ComputeModel,但是,我找不到相应的参数或 属性 来过滤以用于 Get-AzSQLDatabase。可以在 powershell 脚本中完成吗?非常感谢任何正确方向的指示。
Get-AzSQLDatabase
结果中没有ComputeModel
属性,选项是用Get-AzResource
.
命令结果中有一个Kind
属性,对于Provisioned
数据库,是v12.0,user,vcore
,对于Serverless
数据库,它是 v12.0,user,vcore,serverless
,因此我们可以使用它来过滤您订阅中的数据库。
样本:
Get-AzResource -ResourceType Microsoft.Sql/servers/databases | Where-Object {$_.Kind -eq 'v12.0,user,vcore'} | ft
如果您想获取有关数据库的详细信息,可以使用 ConvertTo-Json
。
Get-AzResource -ResourceType Microsoft.Sql/servers/databases | Where-Object {$_.Kind -eq 'v12.0,user,vcore'} | ConvertTo-Json
我正在尝试使用 Powershell 从特定订阅中获取所有“Provisioned”(不是“无服务器”)Azure 数据库的列表。我是 ps 的新手,所以我可能看不到很明显的东西。在 Set-AzSQLDatabase 方法中有一个参数 -ComputeModel,但是,我找不到相应的参数或 属性 来过滤以用于 Get-AzSQLDatabase。可以在 powershell 脚本中完成吗?非常感谢任何正确方向的指示。
Get-AzSQLDatabase
结果中没有ComputeModel
属性,选项是用Get-AzResource
.
命令结果中有一个Kind
属性,对于Provisioned
数据库,是v12.0,user,vcore
,对于Serverless
数据库,它是 v12.0,user,vcore,serverless
,因此我们可以使用它来过滤您订阅中的数据库。
样本:
Get-AzResource -ResourceType Microsoft.Sql/servers/databases | Where-Object {$_.Kind -eq 'v12.0,user,vcore'} | ft
如果您想获取有关数据库的详细信息,可以使用 ConvertTo-Json
。
Get-AzResource -ResourceType Microsoft.Sql/servers/databases | Where-Object {$_.Kind -eq 'v12.0,user,vcore'} | ConvertTo-Json