使用英语阅读

通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Get-AzCosmosDBLocation

列出 Azure Cosmos DB 位置及其属性。 获取特定位置的 Azure Cosmos DB 位置属性。

语法

Get-AzCosmosDBLocation
   [-Location <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

说明

列出 Azure Cosmos DB 位置及其位置属性。 它包括位置 ID、名称、类型、SupportsAvailabilityZone、IsResidencyRestricted、BackupStorageRedundancies、IsSubscriptionRegionAccessAllowedForRegular、IsSubscriptionRegionAccessAllowedForAz 和 Status。

示例

示例 1:获取给定位置的 Azure Cosmos DB 帐户位置属性

Get-AzCosmosDBLocation -Location "Central US"

Id                                                                                                      Name       Type                           Properties
--                                                                                                      ----       ----                           ----------
subscriptionId/subscriptionId/providers/Microsoft.DocumentDB/locations/centralus/ Central US Microsoft.DocumentDB/locations Microsoft.Azure.Commands.CosmosDB.Models.PSLocationP...


Get-AzCosmosDBLocation -Location "Central US" | ConvertTo-Json
{
    "Id":  "subscriptionId/<subscriptionId>/providers/Microsoft.DocumentDB/locations/centralus/",
    "Name":  "Central US",
    "Type":  "Microsoft.DocumentDB/locations",
    "Properties":  {
                       "SupportsAvailabilityZone":  true,
                       "IsResidencyRestricted":  false,
                       "BackupStorageRedundancies":  [
                                                         "Geo",
                                                         "Zone",
                                                         "Local"
                                                     ],
                        "IsSubscriptionRegionAccessAllowedForRegular": true,
                        "IsSubscriptionRegionAccessAllowedForAz": false,
                        "Status": "Online"
                   }
}

示例 2:列出 Azure Cosmos DB 帐户位置及其属性

Get-AzCosmosDBLocation

Id                                                                                                               Name                 Type                           Properties
--                                                                                                               ----                 ----                           ----------
subscriptionId/<subscriptionId>/providers/Microsoft.DocumentDB/locations/brazilsoutheast/    Brazil Southeast     Microsoft.DocumentDB/locations Microsoft.Azure.Commands.CosmosDB...
subscriptionId/<subscriptionId>/providers/Microsoft.DocumentDB/locations/centralus/          Central US           Microsoft.DocumentDB/locations Microsoft.Azure.Commands.CosmosDB...
....


Get-AzCosmosDBLocation | ConvertTo-Json
[
    {
        "Id":  "subscriptionId/<subscriptionId>/providers/Microsoft.DocumentDB/locations/brazilsoutheast/",
        "Name":  "Brazil Southeast",
        "Type":  "Microsoft.DocumentDB/locations",
        "Properties":  {
                           "SupportsAvailabilityZone":  true,
                           "IsResidencyRestricted":  false,
                           "BackupStorageRedundancies":  "Geo Local",
                           "IsSubscriptionRegionAccessAllowedForRegular": true,
                           "IsSubscriptionRegionAccessAllowedForAz": false,
                           "Status": "Online"
                       }
    },
    {
        "Id":  "subscriptionId/<subscriptionId>/providers/Microsoft.DocumentDB/locations/centralus/",
        "Name":  "Central US",
        "Type":  "Microsoft.DocumentDB/locations",
        "Properties":  {
                           "SupportsAvailabilityZone":  true,
                           "IsResidencyRestricted":  false,
                           "BackupStorageRedundancies":  "Geo Zone Local",
                           "IsSubscriptionRegionAccessAllowedForRegular": false,
                           "IsSubscriptionRegionAccessAllowedForAz": true,
                           "Status": "Online"
                       }
    },
    {
        "Id":  "subscriptionId/<subscriptionId>/providers/Microsoft.DocumentDB/locations/australiasoutheast/",
        "Name":  "Australia Southeast",
        "Type":  "Microsoft.DocumentDB/locations",
        "Properties":  {
                           "SupportsAvailabilityZone":  false,
                           "IsResidencyRestricted":  false,
                           "BackupStorageRedundancies":  "Geo Local",
                           "IsSubscriptionRegionAccessAllowedForRegular": true,
                           "IsSubscriptionRegionAccessAllowedForAz": true,
                           "Status": "Online"
                       }
    }
]

参数

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

类型:IAzureContextContainer
别名:AzContext, AzureRmContext, AzureCredential
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-Location

-字符串中位置的名称。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

输入

None

输出

PSLocationGetResult