diff --git a/src/CosmosDB/CosmosDB.Test/ScenarioTests/SqlOperationsTests.ps1 b/src/CosmosDB/CosmosDB.Test/ScenarioTests/SqlOperationsTests.ps1 index 824bd6e2d3fe..57b78f31ce38 100644 --- a/src/CosmosDB/CosmosDB.Test/ScenarioTests/SqlOperationsTests.ps1 +++ b/src/CosmosDB/CosmosDB.Test/ScenarioTests/SqlOperationsTests.ps1 @@ -1019,6 +1019,9 @@ function Test-ClientEncryptionKeyCmdlets Assert-AreEqual $ContainerWithEncryptionPolicy.Resource.ClientEncryptionPolicy.IncludedPaths[1].EncryptionType $EncryptionType_2 Assert-AreEqual $ContainerWithEncryptionPolicy.Resource.ClientEncryptionPolicy.PolicyFormatVersion 1 + #validate update container works on container with encryption policy. + updateContainerTtl = Update-AzCosmosDBSqlContainer -AccountName $AccountName -ResourceGroupName $rgName -DatabaseName $DatabaseName -TtlInSeconds 7200 + Assert-AreEqual updateContainerTtl.Resource.DefaultTtl 7200 } Finally { Remove-AzCosmosDBSqlDatabase -AccountName $AccountName -ResourceGroupName $rgName -Name $DatabaseName diff --git a/src/CosmosDB/CosmosDB/ChangeLog.md b/src/CosmosDB/CosmosDB/ChangeLog.md index 524db2765637..01bf0a504d31 100644 --- a/src/CosmosDB/CosmosDB/ChangeLog.md +++ b/src/CosmosDB/CosmosDB/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release +* Fixed bug related to Update-AzCosmosDBSqlContainer command on containers with Client Encryption Policy. ## Version 1.8.0 * Introduced support for creating containers with Client Encryption Policy. The current supported version of Client Encryption Policy is 1. diff --git a/src/CosmosDB/CosmosDB/SQL/UpdateAzCosmosDBSqlContainer.cs b/src/CosmosDB/CosmosDB/SQL/UpdateAzCosmosDBSqlContainer.cs index c820a8df5eae..d2121ced28ba 100644 --- a/src/CosmosDB/CosmosDB/SQL/UpdateAzCosmosDBSqlContainer.cs +++ b/src/CosmosDB/CosmosDB/SQL/UpdateAzCosmosDBSqlContainer.cs @@ -216,7 +216,8 @@ private static SqlContainerResource PopulateSqlContainerResource(SqlContainerGet DefaultTtl = sqlContainerGetPropertiesResource.DefaultTtl, Id = sqlContainerGetPropertiesResource.Id, IndexingPolicy = sqlContainerGetPropertiesResource.IndexingPolicy, - PartitionKey = sqlContainerGetPropertiesResource.PartitionKey + PartitionKey = sqlContainerGetPropertiesResource.PartitionKey, + ClientEncryptionPolicy = sqlContainerGetPropertiesResource.ClientEncryptionPolicy }; } }