Skip to content

Commit d84f795

Browse files
MehaKaushikMeha Kaushik
andauthored
[CosmosDB]Updating with recent features: Autoscale, EnableFreeTier, ServerVersion, EnableAnalyticalStorage (#12066)
* Updating sdk and relevant changes with the updation * Added Autoscale related changes and EnableFreeTrie, ServerVersion and EnableAnalyticalStorage in Account creation and updation * modifying tests and refactoring update throughput cmdlets * Updated API tests * Refactoring Account cmdlets and tests * added changelog * updated account tests using objects * Updated tests * updated PrivateEndpoint tests * re-ran tests for add-region Co-authored-by: Meha Kaushik <[email protected]>
1 parent 34b22e2 commit d84f795

File tree

94 files changed

+19249
-23498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+19249
-23498
lines changed

src/CosmosDB/CosmosDB.Test/CosmosDB.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</PropertyGroup>
55
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.Test.props" />
66
<ItemGroup>
7-
<PackageReference Include="Microsoft.Azure.Management.CosmosDB" Version="1.1.1" />
7+
<PackageReference Include="Microsoft.Azure.Management.CosmosDB" Version="1.2.0" />
88
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.21.1-preview" />
99
</ItemGroup>
1010
</Project>

src/CosmosDB/CosmosDB.Test/ScenarioTests/AccountTests.ps1

Lines changed: 63 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,44 @@
1414

1515
function Test-AccountRelatedCmdlets
1616
{
17-
$rgName = "CosmosDBResourceGroup3"
17+
$rgName = "CosmosDBResourceGroup89"
1818
$location = "East US"
1919
$locationlist = "East US", "West US"
2020
$locationlist2 = "East US", "UK South", "UK West", "South India"
2121
$locationlist3 = "West US", "East US"
2222

2323
$resourceGroup = New-AzResourceGroup -ResourceGroupName $rgName -Location $location
2424

25-
$cosmosDBAccountName = "cosmosdb671"
25+
$cosmosDBAccountName = "cosmosdb67"
2626

2727
#use an existing account with the following information for Account Update Operations
2828
$cosmosDBExistingAccountName = "dbaccount27"
2929
$existingResourceGroupName = "CosmosDBResourceGroup27"
3030

31-
$ipRangeFilter = "192.168.0.1"
31+
$IpRule = "201.168.50.1"
3232
$tags = @{ name = "test"; Shape = "Square"; Color = "Blue"}
3333
$publicNetworkAccess = "Enabled"
3434

35-
$cosmosDBAccount = New-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName -DefaultConsistencyLevel "BoundedStaleness" -MaxStalenessIntervalInSeconds 10 -MaxStalenessPrefix 20 -Location $location -IpRangeFilter $ipRangeFilter -Tag $tags -EnableVirtualNetwork -EnableMultipleWriteLocations -EnableAutomaticFailover -ApiKind "MongoDB" -PublicNetworkAccess $publicNetworkAccess
36-
do
37-
{
38-
$cosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName
39-
} while ($cosmosDBAccount.ProvisioningState -ne "Succeeded")
35+
$cosmosDBAccount = New-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName -DefaultConsistencyLevel "BoundedStaleness" -MaxStalenessIntervalInSeconds 10 -MaxStalenessPrefix 20 -Location $location -IpRule $IpRule -Tag $tags -EnableVirtualNetwork -EnableMultipleWriteLocations -EnableAutomaticFailover -ApiKind "MongoDB" -PublicNetworkAccess $publicNetworkAccess -EnableFreeTier 0 -EnableAnalyticalStorage 0 -ServerVersion "3.2"
4036

4137
Assert-AreEqual $cosmosDBAccountName $cosmosDBAccount.Name
4238
Assert-AreEqual "BoundedStaleness" $cosmosDBAccount.ConsistencyPolicy.DefaultConsistencyLevel
4339
Assert-AreEqual 10 $cosmosDBAccount.ConsistencyPolicy.MaxIntervalInSeconds
4440
Assert-AreEqual 20 $cosmosDBAccount.ConsistencyPolicy.MaxStalenessPrefix
45-
Assert-AreEqual $ipRangeFilter $cosmosDBAccount.IpRangeFilter
4641
Assert-AreEqual $cosmosDBAccount.EnableAutomaticFailover 1
4742
Assert-AreEqual $cosmosDBAccount.EnableMultipleWriteLocations 1
4843
Assert-AreEqual $cosmosDBAccount.IsVirtualNetworkFilterEnabled 1
4944
Assert-AreEqual $cosmosDBAccount.PublicNetworkAccess $publicNetworkAccess
45+
Assert-AreEqual $cosmosDBAccount.ApiProperties.ServerVersion "3.2"
46+
Assert-AreEqual $cosmosDBAccount.EnableAnalyticalStorage 0
47+
Assert-AreEqual $cosmosDBAccount.EnableFreeTier 0
5048

51-
$updatedCosmosDBAccount = Update-AzCosmosDBAccount -ResourceGroupName $existingResourceGroupName -Name $cosmosDBExistingAccountName -DefaultConsistencyLevel "BoundedStaleness" -MaxStalenessIntervalInSeconds 10 -MaxStalenessPrefix 20 -IpRangeFilter $ipRangeFilter -Tag $tags -EnableVirtualNetwork 1 -EnableAutomaticFailover 1 -PublicNetworkAccess $publicNetworkAccess
52-
do
53-
{
54-
$updatedCosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $existingResourceGroupName -Name $cosmosDBExistingAccountName
55-
} while ($cosmosDBAccount.ProvisioningState -ne "Succeeded")
49+
$updatedCosmosDBAccount = Update-AzCosmosDBAccount -ResourceGroupName $existingResourceGroupName -Name $cosmosDBExistingAccountName -DefaultConsistencyLevel "BoundedStaleness" -MaxStalenessIntervalInSeconds 10 -MaxStalenessPrefix 20 -IpRule $IpRule -Tag $tags -EnableVirtualNetwork 1 -EnableAutomaticFailover 1 -PublicNetworkAccess $publicNetworkAccess
5650

5751
Assert-AreEqual $cosmosDBExistingAccountName $updatedCosmosDBAccount.Name
5852
Assert-AreEqual "BoundedStaleness" $updatedCosmosDBAccount.ConsistencyPolicy.DefaultConsistencyLevel
5953
Assert-AreEqual 10 $updatedCosmosDBAccount.ConsistencyPolicy.MaxIntervalInSeconds
6054
Assert-AreEqual 20 $updatedCosmosDBAccount.ConsistencyPolicy.MaxStalenessPrefix
61-
Assert-AreEqual $ipRangeFilter $updatedCosmosDBAccount.IpRangeFilter
6255
Assert-AreEqual $updatedCosmosDBAccount.EnableAutomaticFailover 1
6356
Assert-AreEqual $updatedCosmosDBAccount.IsVirtualNetworkFilterEnabled 1
6457
Assert-AreEqual $updatedCosmosDBAccount.PublicNetworkAccess $publicNetworkAccess
@@ -88,7 +81,7 @@ function Test-AccountRelatedCmdletsUsingRid
8881
$cosmosDBExistingAccountName = "dbaccount27"
8982
$existingResourceGroupName = "CosmosDBResourceGroup27"
9083

91-
$ipRangeFilter = "192.168.0.1"
84+
$IpRule = "201.168.50.1"
9285
$tags = @{ name = "test"; Shape = "Square"; Color = "Blue"}
9386

9487
$cosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $existingResourceGroupName -Name $cosmosDBExistingAccountName
@@ -98,12 +91,11 @@ function Test-AccountRelatedCmdletsUsingRid
9891
Assert-AreEqual $cosmosDBAccountByRid.ConsistencyPolicy.DefaultConsistencyLevel $cosmosDBAccount.ConsistencyPolicy.DefaultConsistencyLevel
9992
Assert-AreEqual $cosmosDBAccountByRid.ConsistencyPolicy.MaxIntervalInSeconds $cosmosDBAccount.ConsistencyPolicy.MaxIntervalInSeconds
10093
Assert-AreEqual $cosmosDBAccountByRid.ConsistencyPolicy.MaxStalenessPrefix $cosmosDBAccount.ConsistencyPolicy.MaxStalenessPrefix
101-
Assert-AreEqual $cosmosDBAccountByRid.IpRangeFilter $cosmosDBAccount.IpRangeFilter
10294
Assert-AreEqual $cosmosDBAccountByRid.EnableAutomaticFailover $cosmosDBAccount.EnableAutomaticFailover
10395
Assert-AreEqual $cosmosDBAccountByRid.EnableMultipleWriteLocations $cosmosDBAccount.EnableMultipleWriteLocations
10496
Assert-AreEqual $cosmosDBAccountByRid.IsVirtualNetworkFilterEnabled $cosmosDBAccount.IsVirtualNetworkFilterEnabled
10597

106-
$updatedCosmosDBAccount = Update-AzCosmosDBAccount -ResourceId $cosmosDBAccount.Id -DefaultConsistencyLevel "BoundedStaleness" -MaxStalenessIntervalInSeconds 10 -MaxStalenessPrefix 20 -IpRangeFilter $ipRangeFilter -Tag $tags -EnableVirtualNetwork 1 -EnableAutomaticFailover 1
98+
$updatedCosmosDBAccount = Update-AzCosmosDBAccount -ResourceId $cosmosDBAccount.Id -DefaultConsistencyLevel "BoundedStaleness" -MaxStalenessIntervalInSeconds 10 -MaxStalenessPrefix 20 -IpRule $IpRule -Tag $tags -EnableVirtualNetwork 1 -EnableAutomaticFailover 1
10799
do
108100
{
109101
$updatedCosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $existingResourceGroupName -Name $cosmosDBExistingAccountName
@@ -113,7 +105,6 @@ function Test-AccountRelatedCmdletsUsingRid
113105
Assert-AreEqual "BoundedStaleness" $updatedCosmosDBAccount.ConsistencyPolicy.DefaultConsistencyLevel
114106
Assert-AreEqual 10 $updatedCosmosDBAccount.ConsistencyPolicy.MaxIntervalInSeconds
115107
Assert-AreEqual 20 $updatedCosmosDBAccount.ConsistencyPolicy.MaxStalenessPrefix
116-
Assert-AreEqual $ipRangeFilter $updatedCosmosDBAccount.IpRangeFilter
117108
Assert-AreEqual $updatedCosmosDBAccount.EnableAutomaticFailover 1
118109
Assert-AreEqual $updatedCosmosDBAccount.IsVirtualNetworkFilterEnabled 1
119110

@@ -136,12 +127,12 @@ function Test-AccountRelatedCmdletsUsingObject
136127
$cosmosDBExistingAccountName = "dbaccount27"
137128
$existingResourceGroupName = "CosmosDBResourceGroup27"
138129

139-
$ipRangeFilter = "192.168.0.1"
130+
$IpRule = "201.168.50.1"
140131
$tags = @{ name = "test"; Shape = "Square"; Color = "Blue"}
141132

142133
$cosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $existingResourceGroupName -Name $cosmosDBExistingAccountName
143134

144-
$updatedCosmosDBAccount = Update-AzCosmosDBAccount -InputObject $cosmosDBAccount -DefaultConsistencyLevel "BoundedStaleness" -MaxStalenessIntervalInSeconds 10 -MaxStalenessPrefix 20 -IpRangeFilter $ipRangeFilter -Tag $tags -EnableVirtualNetwork 1 -EnableAutomaticFailover 1
135+
$updatedCosmosDBAccount = Update-AzCosmosDBAccount -InputObject $cosmosDBAccount -DefaultConsistencyLevel "BoundedStaleness" -MaxStalenessIntervalInSeconds 10 -MaxStalenessPrefix 20 -IpRule $IpRule -Tag $tags -EnableVirtualNetwork 1 -EnableAutomaticFailover 1
145136
do
146137
{
147138
$updatedCosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $existingResourceGroupName -Name $cosmosDBExistingAccountName
@@ -151,7 +142,6 @@ function Test-AccountRelatedCmdletsUsingObject
151142
Assert-AreEqual "BoundedStaleness" $updatedCosmosDBAccount.ConsistencyPolicy.DefaultConsistencyLevel
152143
Assert-AreEqual 10 $updatedCosmosDBAccount.ConsistencyPolicy.MaxIntervalInSeconds
153144
Assert-AreEqual 20 $updatedCosmosDBAccount.ConsistencyPolicy.MaxStalenessPrefix
154-
Assert-AreEqual $ipRangeFilter $updatedCosmosDBAccount.IpRangeFilter
155145
Assert-AreEqual $updatedCosmosDBAccount.EnableAutomaticFailover 1
156146
Assert-AreEqual $updatedCosmosDBAccount.IsVirtualNetworkFilterEnabled 1
157147

@@ -173,21 +163,27 @@ function Test-AccountRelatedCmdletsUsingObject
173163

174164
function Test-AddRegionOperation
175165
{
176-
$rgName = "CosmosDBResourceGroup2"
166+
$rgName = "CosmosDBResourceGroup3"
177167
$location = "East US"
178168
$locationlist = "East US", "West US"
179-
$cosmosDBAccountName = "testupdateregion"
169+
$cosmosDBAccountName = "testupdateregionpowershell2"
180170
$resourceGroup = New-AzResourceGroup -ResourceGroupName $rgName -Location $location
181171

172+
try{
182173
$cosmosDBAccount = New-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName -Location $location -EnableMultipleWriteLocations -EnableAutomaticFailover
183174
do
184175
{
185-
$cosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName
176+
$cosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName
186177
} while ($cosmosDBAccount.ProvisioningState -ne "Succeeded")
187-
188-
$updatedCosmosDBAccount = Update-AzCosmosDBAccountRegion -ResourceGroupName $rgName -Name $cosmosDBAccountName -Location $locationlist
189-
$updatedCosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName
190-
Assert-AreEqual $cosmosDBAccount.Locations.Count $updatedCosmosDBAccount.Locations.Count - 1
178+
179+
$updatedCosmosDBAccount = Update-AzCosmosDBAccountRegion -ResourceGroupName $rgName -Name $cosmosDBAccountName -Location $locationlist
180+
$updatedCosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName
181+
Assert-AreEqual $cosmosDBAccount.Locations.Count $updatedCosmosDBAccount.Locations.Count - 1
182+
}
183+
finally{
184+
#unable to delete account immediately after adding region
185+
#Remove-AzCosmosDBAccount -ResourceGroupName $rgName -Name $cosmosDBAccountName
186+
}
191187
}
192188

193189
function Test-PrivateEndpoint
@@ -196,41 +192,47 @@ function Test-PrivateEndpoint
196192
$location = "East US"
197193
$peName = "mype";
198194
$storageAccount = "xdmsa2";
195+
$vnetName = "MyVnetPE"
199196

200-
#use an existing account with the following properties
201-
$cosmosDBExistingAccountName = "db9934121"
197+
$cosmosDBAccountName = "db945"
202198
$rgname = "CosmosDBResourceGroup9507"
203199

204-
$cosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $rgname -Name $cosmosDBExistingAccountName
205-
$resourceId = $cosmosDBAccount.Id
200+
try{
201+
$cosmosDBAccount = Get-AzCosmosDBAccount -ResourceGroupName $rgname -Name $cosmosDBAccountName
202+
$resourceId = $cosmosDBAccount.Id
206203

207-
$peSubnet = New-AzVirtualNetworkSubnetConfig -Name peSubnet -AddressPrefix "11.0.1.0/24" -PrivateEndpointNetworkPolicies "Disabled"
208-
$vnetPE = New-AzVirtualNetwork -Name "vnetPE" -ResourceGroupName $rgname -Location $location -AddressPrefix "11.0.0.0/16" -Subnet $peSubnet
204+
$peSubnet = New-AzVirtualNetworkSubnetConfig -Name peSubnet -AddressPrefix "11.0.1.0/24" -PrivateEndpointNetworkPolicies "Disabled"
205+
$vnetPE = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix "11.0.0.0/16" -Subnet $peSubnet
209206

210-
$plsConnection= New-AzPrivateLinkServiceConnection -Name plsConnection -PrivateLinkServiceId $resourceId -GroupId 'Sql'
211-
$privateEndpoint = New-AzPrivateEndpoint -ResourceGroupName $rgname -Name $peName -Location $location -Subnet $vnetPE.subnets[0] -PrivateLinkServiceConnection $plsConnection -ByManualRequest
212-
213-
$pecGet = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $resourceId
214-
Assert-NotNull $pecGet;
215-
Assert-AreEqual "Pending" $pecGet.PrivateLinkServiceConnectionState.Status
216-
217-
# Approve Private Endpoint Connection
218-
$pecApprove = Approve-AzPrivateEndpointConnection -ResourceId $pecGet.Id
219-
Assert-NotNull $pecApprove;
220-
221-
$pecGet2 = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $resourceId
222-
do
223-
{
224-
$pecGet2 = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $resourceId
225-
} while ($pecGet2.PrivateLinkServiceConnectionState.Status -ne "Approved")
226-
227-
# Remove Private Endpoint Connection
228-
$pecRemove = Remove-AzPrivateEndpointConnection -ResourceId $pecGet.Id -PassThru -Force
229-
Assert-AreEqual true $pecRemove
230-
231-
$pecGet3 = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $resourceId
232-
do
233-
{
234-
$pecGet3 = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $resourceId
235-
} while (($pecGet3) -ne $null)
207+
$plsConnection= New-AzPrivateLinkServiceConnection -Name plsConnection -PrivateLinkServiceId $resourceId -GroupId 'Sql'
208+
$privateEndpoint = New-AzPrivateEndpoint -ResourceGroupName $rgname -Name $peName -Location $location -Subnet $vnetPE.subnets[0] -PrivateLinkServiceConnection $plsConnection -ByManualRequest
209+
210+
$pecGet = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $resourceId
211+
Assert-NotNull $pecGet;
212+
Assert-AreEqual "Pending" $pecGet.PrivateLinkServiceConnectionState.Status
213+
214+
# Approve Private Endpoint Connection
215+
$pecApprove = Approve-AzPrivateEndpointConnection -ResourceId $pecGet.Id
216+
Assert-NotNull $pecApprove;
217+
218+
$pecGet2 = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $resourceId
219+
do
220+
{
221+
$pecGet2 = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $resourceId
222+
} while ($pecGet2.PrivateLinkServiceConnectionState.Status -ne "Approved")
223+
224+
# Remove Private Endpoint Connection
225+
$pecRemove = Remove-AzPrivateEndpointConnection -ResourceId $pecGet.Id -PassThru -Force
226+
Assert-AreEqual true $pecRemove
227+
228+
$pecGet3 = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $resourceId
229+
do
230+
{
231+
$pecGet3 = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $resourceId
232+
} while (($pecGet3) -ne $null)
233+
}
234+
finally{
235+
Remove-AzPrivateEndpoint -ResourceGroupName $rgname -Name $peName -Force
236+
Remove-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Force
237+
}
236238
}

src/CosmosDB/CosmosDB.Test/ScenarioTests/SqlOperationsTests.ps1

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,13 @@ function Test-SqlThroughputCmdlets
507507
$UpdatedContainerThroughputValue2 = 600
508508
$UpdatedContainerThroughputValue3 = 500
509509

510+
$DatabaseName2 = "dbName4"
511+
$ContainerName2 = "containerName3"
512+
$AutoscaleContainerThroughput = 5000
513+
$AutoscaleUpdatedContainerThroughput = 10000
514+
$AutoscaleDatabaseThroughput = 8000
515+
$AutoscaleUpdatedDatabaseThroughput = 12000
516+
510517
Try{
511518
$NewDatabase = New-AzCosmosDBSqlDatabase -AccountName $AccountName -ResourceGroupName $rgName -Name $DatabaseName -Throughput $ThroughputValue
512519
$Throughput = Get-AzCosmosDBSqlDatabaseThroughput -AccountName $AccountName -ResourceGroupName $rgName -Name $DatabaseName
@@ -535,11 +542,31 @@ function Test-SqlThroughputCmdlets
535542
$UpdatedContainerThroughput = Update-AzCosmosDBSqlContainerThroughput -ParentObject $NewDatabase -Name $ContainerName -Throughput $UpdatedContainerThroughputValue3
536543
Assert-AreEqual $UpdatedContainerThroughput.Throughput $UpdatedContainerThroughputValue3
537544

545+
# autoscale scenarios
546+
$AutoscaleDatabase = New-AzCosmosDBSqlDatabase -AccountName $AccountName -ResourceGroupName $rgName -Name $DatabaseName2 -AutoscaleMaxThroughput $AutoscaleDatabaseThroughput
547+
$Throughput = Get-AzCosmosDBSqlDatabaseThroughput -AccountName $AccountName -ResourceGroupName $rgName -Name $DatabaseName2
548+
Assert-AreEqual $Throughput.AutoscaleSettings.MaxThroughput $AutoscaleDatabaseThroughput
549+
550+
$AutoscaleContainer = New-AzCosmosDBSqlContainer -AccountName $AccountName -ResourceGroupName $rgName -DatabaseName $DatabaseName2 -AutoscaleMaxThroughput $AutoscaleContainerThroughput -Name $ContainerName2 -PartitionKeyPath $PartitionKeyPathValue -PartitionKeyKind $PartitionKeyKindValue
551+
$ContainerThroughput = Get-AzCosmosDBSqlContainerThroughput -InputObject $AutoscaleContainer
552+
Assert-AreEqual $ContainerThroughput.AutoscaleSettings.MaxThroughput $AutoscaleContainerThroughput
553+
554+
$UpdatedContainerThroughput = Update-AzCosmosDBSqlContainerThroughput -AccountName $AccountName -ResourceGroupName $rgName -DatabaseName $DatabaseName2 -Name $ContainerName2 -AutoscaleMaxThroughput $AutoscaleUpdatedContainerThroughput
555+
Assert-AreEqual $UpdatedContainerThroughput.AutoscaleSettings.MaxThroughput $AutoscaleUpdatedContainerThroughput
556+
557+
# can only update throughput of database if it has atleast one container with shared throughput
558+
# $UpdatedThroughput = Update-AzCosmosDBSqlDatabaseThroughput -InputObject $AutoscaleDatabase -AutoscaleMaxThroughput $AutoscaleUpdatedDatabaseThroughput
559+
# Assert-AreEqual $UpdatedThroughput.AutoscaleSettings.MaxThroughput $AutoscaleUpdatedDatabaseThroughput
560+
538561
Remove-AzCosmosDBSqlContainer -InputObject $NewContainer
539-
Remove-AzCosmosDBSqlDatabase -InputObject $NewDatabase
562+
Remove-AzCosmosDBSqlDatabase -InputObject $NewDatabase
563+
Remove-AzCosmosDBSqlContainer -InputObject $AutoscaleContainer
564+
Remove-AzCosmosDBSqlDatabase -InputObject $AutoscaleDatabase
540565
}
541566
Finally{
542567
Remove-AzCosmosDBSqlContainer -AccountName $AccountName -ResourceGroupName $rgName -DatabaseName $DatabaseName -Name $ContainerName
543-
Remove-AzCosmosDBSqlDatabase -AccountName $AccountName -ResourceGroupName $rgName -Name $DatabaseName
568+
Remove-AzCosmosDBSqlDatabase -AccountName $AccountName -ResourceGroupName $rgName -Name $DatabaseName
569+
Remove-AzCosmosDBSqlContainer -AccountName $AccountName -ResourceGroupName $rgName -DatabaseName $DatabaseName2 -Name $ContainerName2
570+
Remove-AzCosmosDBSqlDatabase -AccountName $AccountName -ResourceGroupName $rgName -Name $DatabaseName2
544571
}
545572
}

0 commit comments

Comments
 (0)