Skip to content

Commit 63d8023

Browse files
committed
Updating changelog & adding validation to test case to verify that ASP move was successful
1 parent 5caa61f commit 63d8023

File tree

3 files changed

+1050
-902
lines changed

3 files changed

+1050
-902
lines changed

src/Websites/Websites.Test/ScenarioTests/WebAppTests.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,8 +1355,10 @@ Tests Tags are not overridden when calling Set-AzWebApp commandlet
13551355
function Test-TagsNotRemovedBySetWebApp
13561356
{
13571357
$rgname = "lketmtestantps10"
1358-
$appname = "lketmtestantps10" # this is an existing app with existing tags
1358+
$appname = "tagstestantps10" # this is an existing app with existing tags
13591359
$slot = "testslot"
1360+
$aspName = "tagstestAspantps10"
1361+
$aspToMove = "tagstestAsp2antps10"
13601362

13611363
$getApp = Get-AzWebApp -ResourceGroupName $rgname -Name $appname
13621364
$getSlot = Get-AzWebAppSlot -ResourceGroupName $rgname -Name $appname -Slot $slot
@@ -1377,9 +1379,16 @@ function Test-TagsNotRemovedBySetWebApp
13771379
$webapp = Set-AzWebApp -WebApp $getApp
13781380
Assert-notNull $webApp.Tags
13791381

1380-
$webapp = Set-AzWebApp -Name $appname -ResourceGroupName $rgname -AppServicePlan "lke-asp2-antps10"
1382+
$webapp = Set-AzWebApp -Name $appname -ResourceGroupName $rgname -AppServicePlan $aspToMove
1383+
# verify that App has been successfully moved to the new ASP
1384+
$asp = Get-AzAppServicePlan -ResourceGroupName $rgname -Name $aspToMove
1385+
Assert-AreEqual $webApp.ServerFarmId $asp.id
1386+
# verify tags are not removed after ASP move
13811387
Assert-notNull $webApp.Tags
1388+
13821389
# Move it back to the original ASP
1383-
$webApp = Set-AzWebApp -Name $appname -ResourceGroupName $rgname -AppServicePlan "lke-asp-antps10"
1390+
$webApp = Set-AzWebApp -Name $appname -ResourceGroupName $rgname -AppServicePlan $aspName
1391+
$asp = Get-AzAppServicePlan -ResourceGroupName $rgname -Name $aspName
1392+
Assert-AreEqual $webApp.ServerFarmId $asp.id
13841393
Assert-notNull $webApp.Tags
13851394
}

0 commit comments

Comments
 (0)