Edit

Update-AzDocumentDBMongoCluster

Update a mongo cluster. update overwrites all properties for the resource. To only modify some of the properties, use PATCH.

Syntax

UpdateExpanded (Default)

Update-AzDocumentDBMongoCluster
    -Name <String>
    -ResourceGroupName <String>
    [-SubscriptionId <String>]
    [-AdministratorPassword <SecureString>]
    [-AdministratorUserName <String>]
    [-AuthConfigAllowedMode <String[]>]
    [-ComputeTier <String>]
    [-CustomerManagedKeyEncryptionKeyUrl <String>]
    [-DataApiMode <String>]
    [-EnableSystemAssignedIdentity <Boolean>]
    [-HighAvailabilityTargetMode <String>]
    [-KeyEncryptionKeyIdentityType <String>]
    [-KeyEncryptionKeyIdentityUserAssignedIdentityResourceId <String>]
    [-NetworkBypassMode <String>]
    [-PreviewFeature <String[]>]
    [-PublicNetworkAccess <String>]
    [-ServerVersion <String>]
    [-ShardingShardCount <Int32>]
    [-StorageSizeGb <Int64>]
    [-StorageType <String>]
    [-Tag <Hashtable>]
    [-UserAssignedIdentity <String[]>]
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

UpdateViaIdentityExpanded

Update-AzDocumentDBMongoCluster
    -InputObject <IDocumentDbIdentity>
    [-AdministratorPassword <SecureString>]
    [-AdministratorUserName <String>]
    [-AuthConfigAllowedMode <String[]>]
    [-ComputeTier <String>]
    [-CustomerManagedKeyEncryptionKeyUrl <String>]
    [-DataApiMode <String>]
    [-EnableSystemAssignedIdentity <Boolean>]
    [-HighAvailabilityTargetMode <String>]
    [-KeyEncryptionKeyIdentityType <String>]
    [-KeyEncryptionKeyIdentityUserAssignedIdentityResourceId <String>]
    [-NetworkBypassMode <String>]
    [-PreviewFeature <String[]>]
    [-PublicNetworkAccess <String>]
    [-ServerVersion <String>]
    [-ShardingShardCount <Int32>]
    [-StorageSizeGb <Int64>]
    [-StorageType <String>]
    [-Tag <Hashtable>]
    [-UserAssignedIdentity <String[]>]
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Update a mongo cluster. update overwrites all properties for the resource. To only modify some of the properties, use PATCH.

Examples

Example 1: Update the tags of a mongo cluster

Update-AzDocumentDBMongoCluster -Name myCluster -ResourceGroupName myResourceGroup -Tag @{ env = 'test'; owner = 'cli' }
Name        Location ProvisioningState
----        -------- -----------------
myCluster   eastus2  Succeeded

Update a mongo cluster to apply resource tags.

Example 2: Enable the Mongo data API on a mongo cluster

Update-AzDocumentDBMongoCluster -Name myCluster -ResourceGroupName myResourceGroup -DataApiMode Enabled
Name        Location ProvisioningState
----        -------- -----------------
myCluster   eastus2  Succeeded

Enable the Mongo data API. The data API can only be toggled once the cluster is provisioned and while public network access is enabled.

Example 3: Add a user-assigned managed identity

$identityId = '/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identity-name>'
$cluster = Get-AzDocumentDBMongoCluster -Name myCluster -ResourceGroupName myResourceGroup
$identityIds = @()
$identityProperty = $cluster.PSObject.Properties['IdentityUserAssignedIdentity']
if (($null -ne $identityProperty) -and ($null -ne $identityProperty.Value)) {
    $identityIds += @($identityProperty.Value.Keys)
}
if ($identityId -notin $identityIds) {
    $identityIds += $identityId
}
$cluster | Update-AzDocumentDBMongoCluster -UserAssignedIdentity $identityIds
Name        Location ProvisioningState
----        -------- -----------------
myCluster   eastus2  Succeeded

Get the existing identities, add the identity if it is not already assigned, and apply the updated collection to the cluster. This also works when the cluster has no existing user-assigned identities.

Parameters

-AdministratorPassword

The administrator password.

Parameter properties

Type:SecureString
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

-AdministratorUserName

The administrator user name.

Parameter properties

Type:String
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

-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

-AuthConfigAllowedMode

Allowed authentication modes for data access on the cluster.

Parameter properties

Type:

String[]

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

-ComputeTier

The compute tier to assign to the cluster, where each tier maps to a virtual-core and memory size. Example values: 'M30', 'M40'.

Parameter properties

Type:String
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

-CustomerManagedKeyEncryptionKeyUrl

The URI of the key vault key used for encryption.

Parameter properties

Type:String
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

-DataApiMode

The mode to indicate whether the Mongo Data API is enabled for a cluster.

Parameter properties

Type:String
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

-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

-EnableSystemAssignedIdentity

Determines whether to enable a system-assigned identity for the resource.

Parameter properties

Type:

Nullable<T>[Boolean]

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

-HighAvailabilityTargetMode

The target high availability mode requested for the cluster.

Parameter properties

Type:String
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

-InputObject

Identity Parameter

Parameter properties

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

Parameter sets

UpdateViaIdentityExpanded
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-KeyEncryptionKeyIdentityType

The type of identity. Only 'UserAssignedIdentity' is supported.

Parameter properties

Type:String
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

-KeyEncryptionKeyIdentityUserAssignedIdentityResourceId

The user assigned identity resource id.

Parameter properties

Type:String
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

-Name

The name of the mongo cluster.

Parameter properties

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

Parameter sets

UpdateExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NetworkBypassMode

The network bypass mode for the cluster. Setting to 'AzureCosmosDB' allows Azure Cosmos DB service to bypass network restrictions.

Parameter properties

Type:String
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

-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

-PreviewFeature

List of private endpoint connections.

Parameter properties

Type:

String[]

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

-PublicNetworkAccess

Whether or not public endpoint access is allowed for this mongo cluster.

Parameter properties

Type:String
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

UpdateExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ServerVersion

The Mongo DB server version. Defaults to the latest available version if not specified.

Parameter properties

Type:String
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

-ShardingShardCount

Number of shards to provision on the cluster.

Parameter properties

Type:Int32
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

-StorageSizeGb

The size of the data disk assigned to each server.

Parameter properties

Type:Int64
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

-StorageType

The type of storage to provision the cluster servers with.

Parameter properties

Type:String
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

-SubscriptionId

The ID of the target subscription. The value must be an UUID.

Parameter properties

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

Parameter sets

UpdateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Tag

Resource tags.

Parameter properties

Type:Hashtable
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

-UserAssignedIdentity

The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'

Parameter properties

Type:

String[]

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

-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.

Inputs

IDocumentDbIdentity

Outputs

IMongoCluster