Edit

New-AzDocumentDBReplica

Create a read replica of an existing mongo cluster.

Syntax

Default (Default)

New-AzDocumentDBReplica
    -Name <String>
    -ResourceGroupName <String>
    [-SubscriptionId <String>]
    -Location <String>
    -SourceCluster <String>
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Create a read replica of an existing mongo cluster. The source cluster must have the "GeoReplicas" preview feature enabled. The replica is provisioned as a new mongo cluster and inherits its configuration (compute, storage, sharding) from the source cluster. A replica in the same region as the source is created as an in-region 'AsyncReplica'; a replica in a different region is created as a cross-region 'GeoAsyncReplica'.

Examples

Example 1: Create a cross-region read replica of a mongo cluster

New-AzDocumentDBReplica -Name myReplica -ResourceGroupName myResourceGroup -Location westus2 -SourceCluster myCluster
Name        Location ProvisioningState
----        -------- -----------------
myReplica   westus2  Succeeded

Create a cross-region read replica of a source mongo cluster. The replica inherits its configuration and administrator credentials from the source, so no password is supplied. A replica placed in a different region is created as a GeoAsyncReplica. The source cluster must have the GeoReplicas preview feature enabled.

Parameters

-AsJob

Run the command as a job.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Parameter properties

Type:PSObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureRMContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Location

The geo-location where the replica lives.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The name of the replica mongo cluster to create.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:MongoClusterName

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NoWait

Run the command asynchronously.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The name of the resource group. The name is case insensitive.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SourceCluster

Name or resource ID of the source (primary) mongo cluster to replicate from. If a name is given, the current subscription and resource group are assumed. Provide a full ARM ID for a source in another resource group or subscription.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SubscriptionId

The ID of the target subscription.

Parameter properties

Type:String
Default value:(Get-AzContext).Subscription.Id
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

IMongoCluster