Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/CosmosDB/CosmosDB.Test/ScenarioTests/AccountTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Test-AccountRelatedCmdlets
Assert-AreEqual $_.Exception.Message ("Resource with Name " + $cosmosDBAccountName + " already exists.")
}

$updatedCosmosDBAccount = Update-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName -DefaultConsistencyLevel "BoundedStaleness" -MaxStalenessIntervalInSeconds 10 -MaxStalenessPrefix 20 -IpRule $IpRule -Tag $tags -EnableVirtualNetwork 1 -EnableAutomaticFailover 1 -PublicNetworkAccess $publicNetworkAccess -NetworkAclBypassResourceId $networkAclBypassResourceId
$updatedCosmosDBAccount = Update-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName -DefaultConsistencyLevel "BoundedStaleness" -MaxStalenessIntervalInSeconds 10 -MaxStalenessPrefix 20 -IpRule $IpRule -Tag $tags -EnableVirtualNetwork 1 -EnableAutomaticFailover 1 -PublicNetworkAccess $publicNetworkAccess -NetworkAclBypassResourceId $networkAclBypassResourceId -EnablePartitionMerge 0

Assert-AreEqual $cosmosDBAccountName $updatedCosmosDBAccount.Name
Assert-AreEqual "BoundedStaleness" $updatedCosmosDBAccount.ConsistencyPolicy.DefaultConsistencyLevel
Expand All @@ -72,6 +72,7 @@ function Test-AccountRelatedCmdlets
Assert-AreEqual $updatedCosmosDBAccount.NetworkAclBypassResourceIds.Count 1
Assert-AreEqual $updatedCosmosDBAccount.BackupPolicy.BackupIntervalInMinutes 480
Assert-AreEqual $updatedCosmosDBAccount.BackupPolicy.BackupRetentionIntervalInHours 16
Assert-AreEqual $updatedCosmosDBAccount.EnablePartitionMerge 0

$updatedCosmosDBAccount = Update-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName -BackupStorageRedundancy "Geo"
Assert-AreEqual $updatedCosmosDBAccount.BackupPolicy.BackupIntervalInMinutes 480
Expand Down
1 change: 1 addition & 0 deletions src/CosmosDB/CosmosDB/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

## Upcoming Release
* Added support for Continuous 7 Days backup mode.
* Added new parameter `EnablePartitionMerge` to `Update-AzCosmosDBAccount` and `New-AzCosmosDBAccount`.

## Version 1.10.1
* Updated Azure.Core to 1.31.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public class NewOrUpdateAzCosmosDBAccount : AzureCosmosDBCmdletBase
[Parameter(Mandatory = false, HelpMessage = Constants.EnableAnalyticalStorageHelpMessage)]
public bool? EnableAnalyticalStorage { get; set; }

[Parameter(Mandatory = false, HelpMessage = Constants.EnablePartitionMergeHelpMessage)]
public bool? EnablePartitionMerge { get; set; }

[Parameter(Mandatory = false, HelpMessage = Constants.AsJobHelpMessage)]
public SwitchParameter AsJob { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public override void ExecuteCmdlet()
{
databaseAccountUpdateParameters.EnableAnalyticalStorage = EnableAnalyticalStorage;
}
if (EnablePartitionMerge != null)
{
databaseAccountUpdateParameters.EnablePartitionMerge = EnablePartitionMerge;
}
if (NetworkAclBypass != null)
{
databaseAccountUpdateParameters.NetworkAclBypass =
Expand Down
1 change: 1 addition & 0 deletions src/CosmosDB/CosmosDB/Helpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ internal static class Constants
public const string NetworkAclBypassResourceIdHelpMessage = "List of Resource Ids to allow Network Acl Bypass for Synapse Link.";
public const string DatabaseResourceIdHelpMessage = "ResourceId of the database.";
public const string AnalyticalStorageSchemaTypeHelpMessage = "The schema type for analytical storage. Valid values include: 'WellDefined' and 'FullFidelity'.";
public const string EnablePartitionMergeHelpMessage = "Enables partition merge feature on the Cosmos DB database account. Accepted values: false, true";

//Restore specific help messages
public const string IsRestoreRequestHelpMessage = "Indicates that the new Cosmos DB account request is a restore request.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public PSDatabaseAccountGetResults(DatabaseAccountGetResults databaseAccountGetR
RestoreParameters = new PSRestoreParameters(databaseAccountGetResults.RestoreParameters);
CreateMode = databaseAccountGetResults.CreateMode;
AnalyticalStorageConfiguration = new PSAnalyticalStorageConfiguration(databaseAccountGetResults.AnalyticalStorageConfiguration);
EnablePartitionMerge = databaseAccountGetResults.EnablePartitionMerge;
}

//
Expand Down Expand Up @@ -189,6 +190,10 @@ public PSDatabaseAccountGetResults(DatabaseAccountGetResults databaseAccountGetR
public bool? EnableAnalyticalStorage { get; set; }
//
// Summary:
// Gets or sets flag to indicate whether Partition Merge is enabled.
public bool? EnablePartitionMerge { get; set; }
//
// Summary:
// Gets or sets flag to indicate to allow Network Acl Bypass.
public NetworkAclBypass? NetworkAclBypass { get; set; }
//
Expand Down
17 changes: 16 additions & 1 deletion src/CosmosDB/CosmosDB/help/New-AzCosmosDBAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ New-AzCosmosDBAccount [-EnableAutomaticFailover] [-EnableMultipleWriteLocations]
[-PublicNetworkAccess <String>] [-KeyVaultKeyUri <String>] [-EnableAnalyticalStorage <Boolean>] [-AsJob]
[-NetworkAclBypass <String>] [-NetworkAclBypassResourceId <String[]>] [-ServerVersion <String>]
[-BackupIntervalInMinutes <Int32>] [-BackupRetentionIntervalInHours <Int32>]
[-BackupStorageRedundancy <String>] [-BackupPolicyType <String>] [-ContinuousTier <String>] [-AnalyticalStorageSchemaType <String>]
[-BackupStorageRedundancy <String>] [-BackupPolicyType <String>] [-ContinuousTier <String>] [-AnalyticalStorageSchemaType <String>] [-EnablePartitionMerge <Boolean>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

Expand Down Expand Up @@ -261,6 +261,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -EnablePartitionMerge
Bool to indicate if PartitionMerge is enabled on the account.
Accepted Values: false, true
```yaml
Type: System.Nullable`1[System.Boolean]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: 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.
Expand Down
22 changes: 19 additions & 3 deletions src/CosmosDB/CosmosDB/help/Update-AzCosmosDBAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Update-AzCosmosDBAccount [-EnableAutomaticFailover <Boolean>] [-EnableMultipleWr
[-PublicNetworkAccess <String>] [-KeyVaultKeyUri <String>] [-EnableAnalyticalStorage <Boolean>] [-AsJob]
[-NetworkAclBypass <String>] [-NetworkAclBypassResourceId <String[]>] [-ServerVersion <String>]
[-BackupIntervalInMinutes <Int32>] [-BackupRetentionIntervalInHours <Int32>]
[-BackupStorageRedundancy <String>] [-BackupPolicyType <String>] [-ContinuousTier <String>] [-AnalyticalStorageSchemaType <String>]
[-BackupStorageRedundancy <String>] [-BackupPolicyType <String>] [-ContinuousTier <String>] [-AnalyticalStorageSchemaType <String>] [-EnablePartitionMerge <Boolean>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

Expand All @@ -36,7 +36,7 @@ Update-AzCosmosDBAccount -ResourceId <String> [-EnableAutomaticFailover <Boolean
[-PublicNetworkAccess <String>] [-KeyVaultKeyUri <String>] [-EnableAnalyticalStorage <Boolean>] [-AsJob]
[-NetworkAclBypass <String>] [-NetworkAclBypassResourceId <String[]>] [-ServerVersion <String>]
[-BackupIntervalInMinutes <Int32>] [-BackupRetentionIntervalInHours <Int32>]
[-BackupStorageRedundancy <String>] [-BackupPolicyType <String>] [-ContinuousTier <String>] [-AnalyticalStorageSchemaType <String>]
[-BackupStorageRedundancy <String>] [-BackupPolicyType <String>] [-ContinuousTier <String>] [-AnalyticalStorageSchemaType <String>] [-EnablePartitionMerge <Boolean>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

Expand All @@ -50,7 +50,7 @@ Update-AzCosmosDBAccount -InputObject <PSDatabaseAccountGetResults> [-EnableAuto
[-PublicNetworkAccess <String>] [-KeyVaultKeyUri <String>] [-EnableAnalyticalStorage <Boolean>] [-AsJob]
[-NetworkAclBypass <String>] [-NetworkAclBypassResourceId <String[]>] [-ServerVersion <String>]
[-BackupIntervalInMinutes <Int32>] [-BackupRetentionIntervalInHours <Int32>]
[-BackupStorageRedundancy <String>] [-BackupPolicyType <String>] [-ContinuousTier <String>] [-AnalyticalStorageSchemaType <String>]
[-BackupStorageRedundancy <String>] [-BackupPolicyType <String>] [-ContinuousTier <String>] [-AnalyticalStorageSchemaType <String>] [-EnablePartitionMerge <Boolean>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

Expand Down Expand Up @@ -274,6 +274,22 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -EnablePartitionMerge
Enable Partition Merge on Account
Accepted values: false, true

```yaml
Type: System.Nullable`1[System.Boolean]
Parameter Sets: (All)
Aliases:

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

### -EnableMultipleWriteLocations
Enable Multiple Write Locations.
Accepted values: false, true
Expand Down