Edit

Share via


Update-AzCosmosDBAccount

Update a Cosmos DB Account attributes.

Syntax

ByNameParameterSet (Default)

Update-AzCosmosDBAccount
    -ResourceGroupName <String>
    -Name <String>
    [-EnableAutomaticFailover <Boolean>]
    [-EnableMultipleWriteLocations <Boolean>]
    [-EnableVirtualNetwork <Boolean>]
    [-DisableKeyBasedMetadataWriteAccess <Boolean>]
    [-DefaultConsistencyLevel <String>]
    [-IpRule <String[]>]
    [-MaxStalenessIntervalInSeconds <Int32>]
    [-MaxStalenessPrefix <Int32>]
    [-Tag <Hashtable>]
    [-VirtualNetworkRule <String[]>]
    [-VirtualNetworkRuleObject <PSVirtualNetworkRule[]>]
    [-PublicNetworkAccess <String>]
    [-KeyVaultKeyUri <String>]
    [-EnableAnalyticalStorage <Boolean>]
    [-EnablePartitionMerge <Boolean>]
    [-EnableBurstCapacity <Boolean>]
    [-AsJob]
    [-NetworkAclBypass <String>]
    [-NetworkAclBypassResourceId <String[]>]
    [-ServerVersion <String>]
    [-BackupIntervalInMinutes <Int32>]
    [-BackupRetentionIntervalInHours <Int32>]
    [-BackupStorageRedundancy <String>]
    [-BackupPolicyType <String>]
    [-ContinuousTier <String>]
    [-AnalyticalStorageSchemaType <String>]
    [-MinimalTlsVersion <String>]
    [-EnablePerRegionPerPartitionAutoscale <Boolean>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByResourceIdParameterSet

Update-AzCosmosDBAccount
    -ResourceId <String>
    [-EnableAutomaticFailover <Boolean>]
    [-EnableMultipleWriteLocations <Boolean>]
    [-EnableVirtualNetwork <Boolean>]
    [-DisableKeyBasedMetadataWriteAccess <Boolean>]
    [-DefaultConsistencyLevel <String>]
    [-IpRule <String[]>]
    [-MaxStalenessIntervalInSeconds <Int32>]
    [-MaxStalenessPrefix <Int32>]
    [-Tag <Hashtable>]
    [-VirtualNetworkRule <String[]>]
    [-VirtualNetworkRuleObject <PSVirtualNetworkRule[]>]
    [-PublicNetworkAccess <String>]
    [-KeyVaultKeyUri <String>]
    [-EnableAnalyticalStorage <Boolean>]
    [-EnablePartitionMerge <Boolean>]
    [-EnableBurstCapacity <Boolean>]
    [-AsJob]
    [-NetworkAclBypass <String>]
    [-NetworkAclBypassResourceId <String[]>]
    [-ServerVersion <String>]
    [-BackupIntervalInMinutes <Int32>]
    [-BackupRetentionIntervalInHours <Int32>]
    [-BackupStorageRedundancy <String>]
    [-BackupPolicyType <String>]
    [-ContinuousTier <String>]
    [-AnalyticalStorageSchemaType <String>]
    [-MinimalTlsVersion <String>]
    [-EnablePerRegionPerPartitionAutoscale <Boolean>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByObjectParameterSet

Update-AzCosmosDBAccount
    -InputObject <PSDatabaseAccountGetResults>
    [-EnableAutomaticFailover <Boolean>]
    [-EnableMultipleWriteLocations <Boolean>]
    [-EnableVirtualNetwork <Boolean>]
    [-DisableKeyBasedMetadataWriteAccess <Boolean>]
    [-DefaultConsistencyLevel <String>]
    [-IpRule <String[]>]
    [-MaxStalenessIntervalInSeconds <Int32>]
    [-MaxStalenessPrefix <Int32>]
    [-Tag <Hashtable>]
    [-VirtualNetworkRule <String[]>]
    [-VirtualNetworkRuleObject <PSVirtualNetworkRule[]>]
    [-PublicNetworkAccess <String>]
    [-KeyVaultKeyUri <String>]
    [-EnableAnalyticalStorage <Boolean>]
    [-EnablePartitionMerge <Boolean>]
    [-EnableBurstCapacity <Boolean>]
    [-AsJob]
    [-NetworkAclBypass <String>]
    [-NetworkAclBypassResourceId <String[]>]
    [-ServerVersion <String>]
    [-BackupIntervalInMinutes <Int32>]
    [-BackupRetentionIntervalInHours <Int32>]
    [-BackupStorageRedundancy <String>]
    [-BackupPolicyType <String>]
    [-ContinuousTier <String>]
    [-AnalyticalStorageSchemaType <String>]
    [-MinimalTlsVersion <String>]
    [-EnablePerRegionPerPartitionAutoscale <Boolean>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Update the properties of a Cosmos DB account. Cannot update Account Regions simultaneously with other properties.

Examples

Example 1

Update-AzCosmosDBAccount -ResourceGroupName resourceGroupName -Name accountName -DefaultConsistencyLevel "Strong" -EnableAutomaticFailover 1 -EnableMultipleWriteLocations 1 -EnableVirtualNetwork 1
Kind                          : GlobalDocumentDB
ProvisioningState             : Initializing
DocumentEndpoint              :
DatabaseAccountOfferType      : Standard
IpRangeFilter                 :
IsVirtualNetworkFilterEnabled : True
EnableAutomaticFailover       : True
ConsistencyPolicy             : Microsoft.Azure.Management.CosmosDB.Fluent.Models.ConsistencyPolicy
Capabilities                  : {}
WriteLocations                : {accountName-eastus}
ReadLocations                 : {accountName-eastus}
FailoverPolicies              : {accountName-eastus}
VirtualNetworkRules           : {}
EnableMultipleWriteLocations  : True
Location                      : East US
Tags                          : {}
Id                            : /subscriptions/{subscriptionid}/resourceGroups/resourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/accountName
Name                          : accountName
Type                          : Microsoft.DocumentDB/databaseAccounts
NetworkAclBypass              : None
NetworkAclBypassResourceIds   : {}

Updated DefaultConsistencyLevel to "Strong", Enabled AutomaticFailover, Enabled MultipleWriteLocations and Enabled VirtualNetwork for Cosmos DB Account with name accountName.

Parameters

-AnalyticalStorageSchemaType

The schema type for analytical storage. Valid values include: 'WellDefined' and 'FullFidelity'.

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 cmdlet in the background

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

-BackupIntervalInMinutes

The interval(in minutes) with which backup are taken (only for accounts with periodic mode backups)

Parameter properties

Type:

Nullable<T>[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

-BackupPolicyType

The type of backups on the Cosmos DB account. Accepted values: Periodic, Continuous

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

-BackupRetentionIntervalInHours

The time(in hours) for which each backup is retained (only for accounts with periodic mode backups)

Parameter properties

Type:

Nullable<T>[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

-BackupStorageRedundancy

The redundancy type of the backup Storage account

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

-ContinuousTier

The tier of continuous backups mode on the Cosmos DB account. Accepted values: Continuous7Days, Continuous30Days

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

-DefaultConsistencyLevel

Default consistency level of the Cosmos DB database account. Accepted values: BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong

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 credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, 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

-DisableKeyBasedMetadataWriteAccess

Disable write operations on metadata resources (databases, containers, throughput) via account keys

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

-EnableAnalyticalStorage

Bool to indicate if AnalyticalStorage is enabled on the account.

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

-EnableAutomaticFailover

Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. Accepted values: false, true

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

-EnableBurstCapacity

Bool to indicate if Burst Capacity is enabled on the account.

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

-EnableMultipleWriteLocations

Enable Multiple Write Locations. Accepted values: false, true

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

-EnablePartitionMerge

Enable Partition Merge on Account Accepted values: false, true

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

-EnablePerRegionPerPartitionAutoscale

Bool to indicate if Dynamic Scaling (Per Region Per Partition Autoscale) is enabled on the account.

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

-EnableVirtualNetwork

Enables virtual network on the Cosmos DB database account. Accepted values: false, true

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

-InputObject

Cosmos DB Account object

Parameter properties

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

Parameter sets

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

-IpRule

Firewall support. Specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.

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

-KeyVaultKeyUri

URI of the KeyVault

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

-MaxStalenessIntervalInSeconds

When used with Bounded Staleness consistency, this value represents the time amount of staleness (in timespan) tolerated. Accepted range for this value is 5-86400.

Parameter properties

Type:

Nullable<T>[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

-MaxStalenessPrefix

When used with Bounded Staleness consistency, this value represents the number of stale requests tolerated. Accepted range for this value is 1 - 2,147,483,647.

Parameter properties

Type:

Nullable<T>[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

-MinimalTlsVersion

Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12'.

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

Name of the Cosmos DB database account.

Parameter properties

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

Parameter sets

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

-NetworkAclBypass

Whether or not Network Acl Bypass is enabled for this account for Synapse Link. Possible values include: 'None', 'AzureServices'.

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

-NetworkAclBypassResourceId

List of Resource Ids to allow Network Acl Bypass for Synapse Link.

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 server. Possible values include: 'Enabled', 'Disabled'

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

Name of resource group.

Parameter properties

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

Parameter sets

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

-ResourceId

ResourceId of the resource.

Parameter properties

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

Parameter sets

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

-ServerVersion

ServerVersion, valid only in case of MongoDB Accounts.

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

-Tag

Hashtable of tags as key-value pairs. Use empty string to clear existing tag.

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

-VirtualNetworkRule

Array of string values of ACL's for virtual network.

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

-VirtualNetworkRuleObject

Array of PSVirtualNetworkRuleObjects for virtual network.

Parameter properties

Type:

PSVirtualNetworkRule[]

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

PSDatabaseAccountGetResults

Outputs

PSDatabaseAccountGetResults