@@ -1355,8 +1355,10 @@ Tests Tags are not overridden when calling Set-AzWebApp commandlet
1355
1355
function Test-TagsNotRemovedBySetWebApp
1356
1356
{
1357
1357
$rgname = " lketmtestantps10"
1358
- $appname = " lketmtestantps10 " # this is an existing app with existing tags
1358
+ $appname = " tagstestantps10 " # this is an existing app with existing tags
1359
1359
$slot = " testslot"
1360
+ $aspName = " tagstestAspantps10"
1361
+ $aspToMove = " tagstestAsp2antps10"
1360
1362
1361
1363
$getApp = Get-AzWebApp - ResourceGroupName $rgname - Name $appname
1362
1364
$getSlot = Get-AzWebAppSlot - ResourceGroupName $rgname - Name $appname - Slot $slot
@@ -1377,9 +1379,16 @@ function Test-TagsNotRemovedBySetWebApp
1377
1379
$webapp = Set-AzWebApp - WebApp $getApp
1378
1380
Assert-notNull $webApp.Tags
1379
1381
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
1381
1387
Assert-notNull $webApp.Tags
1388
+
1382
1389
# 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
1384
1393
Assert-notNull $webApp.Tags
1385
1394
}
0 commit comments