如何判断CosmosDB账户的API类型?PowerShell命令未返回该信息
获取Azure CosmosDB账户的API类型
你可以通过提取Get-AzCosmosDBAccount返回对象的ApiKind属性来查看API类型,具体命令如下:
查看指定资源组内所有CosmosDB账户的API类型
Get-AzCosmosDBAccount -ResourceGroupName MyResourceGroupName | Select-Object Name, ApiKind
API类型对应关系
返回的ApiKind值与你提到的6种API类型对应关系如下:
Sql→ NoSQLMongoDB→ MongoDBCassandra→ CassandraGremlin→ GremlinTable→ TablePostgreSql→ PostgreSQL
批量导出到CSV(方便后续批量处理)
Get-AzCosmosDBAccount -ResourceGroupName MyResourceGroupName | Select-Object Name, ApiKind | Export-Csv -Path ".\CosmosDBApiTypes.csv" -NoTypeInformation
查看所有资源组的CosmosDB账户API类型
如果需要遍历全订阅内所有资源组的账户,可省略-ResourceGroupName参数:
Get-AzCosmosDBAccount | Select-Object Name, ResourceGroupName, ApiKind
内容的提问来源于stack exchange,提问作者Vinny
相关产品推荐
相关产品推荐

