Modifier

Partager via


Update-AzCosmosDBAccountRegion

Update Regions of a Cosmos DB Account.

Syntax

Update-AzCosmosDBAccountRegion
      -ResourceGroupName <String>
      -Name <String>
      [-Location <String[]>]
      [-LocationObject <PSLocation[]>]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzCosmosDBAccountRegion
      [-Location <String[]>]
      [-LocationObject <PSLocation[]>]
      -ResourceId <String>
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzCosmosDBAccountRegion
      [-Location <String[]>]
      [-LocationObject <PSLocation[]>]
      -InputObject <PSDatabaseAccountGetResults>
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Update Regions of a Cosmos DB Account. Location can be provided either as an object of type PSLocation or as strings of Location Name ordered by failover priority. LocationObject parameter expects the list of current locations (failover priorities included) appended by the new LocationObjects corresponding to new locations to be added. Location parameter expects the list of current location(ordered by failover priority) and the new locations. Please note, we only support Addition of Regions. Please provide either Location or LocationObject.

Examples

Example 1

Update-AzCosmosDBAccountRegion -ResourceGroupName rg -Name dbname -Location "location1", "location2"

Id                            : /subscriptions/{subscriptionid}/resourceGroups/rg/providers/Microsoft.DocumentDB/databaseAccounts/dbname
Name                          : dbname
Location                      : location1
Tags                          : {}
EnableCassandraConnector      :
EnableMultipleWriteLocations  : True
VirtualNetworkRules           : {}
FailoverPolicies              : {dbname-location1, dbname-location2}
Locations                     : {dbname-location1, dbname-location2}
ReadLocations                 : {dbname-location1, dbname-location2}
WriteLocations                : {dbname-location1}
Capabilities                  : {}
ConsistencyPolicy             : Microsoft.Azure.Management.CosmosDB.Fluent.Models.ConsistencyPolicy
EnableAutomaticFailover       : False
IsVirtualNetworkFilterEnabled : False
IpRules                       : {}
DatabaseAccountOfferType      : Standard
DocumentEndpoint              : https://dbname.documents.azure.com:443/
ProvisioningState             : Succeeded
Kind                          : GlobalDocumentDB

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

ResourceId of the resource.

Type:PSDatabaseAccountGetResults
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Location

Name of the location to be added.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LocationObject

Add a location to the Cosmos DB database account. Array of PSLocation objects.

Type:PSLocation[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Name of the Cosmos DB database account.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Name of resource group.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

ResourceId of the resource.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Commands.CosmosDB.Models.PSDatabaseAccount

Outputs

Microsoft.Azure.Commands.CosmosDB.Models.PSDatabaseAccount