Skip to content

cmdlet changes for creating and managing windows container web app #7191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 16, 2018
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
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@

#### AzureRM.Websites
* Updating to use the latest .NET SDK version (2.0.0)
* New-AzureRmAppServicePlan -HyperV switch is added for create app service plan with windows container
* New-AzureRmWebApp/ New-AzureRmWebAppSlot/ Set-AzureRmWebApp/ Set-AzureRmWebAppSlot - New parameters (–ContainerRegistryUser string -ContainerRegistryPassword secureString -EnableContainerContinuousDeployment) added for creating and managing windows container app

## 6.8.1 - August 2018
#### General
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AppServicePlanTests\TestCreateNewAppServicePlan.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AppServicePlanTests\TestCreateNewAppServicePlanHyperV.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AppServicePlanTests\TestCreateNewAppServicePlanInAse.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -179,6 +182,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCreateNewWebApp.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCreateNewWebAppHyperV.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCreateNewWebAppSimple.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public void TestCreateNewAppServicePlan()
WebsitesController.NewInstance.RunPsTest(_logger, "Test-CreateNewAppServicePlan");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateNewAppServicePlanHyperV()
{
WebsitesController.NewInstance.RunPsTest(_logger, "Test-CreateNewAppServicePlanHyperV");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSetAppServicePlan()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,56 @@ function Test-CreateNewAppServicePlan
}
}

<#
.SYNOPSIS
Tests creating a new Web Hosting Plan with HyperV container.
#>
function Test-CreateNewAppServicePlanHyperV
{
# Setup
$rgname = Get-ResourceGroupName
$whpName = Get-WebHostPlanName
$location = Get-Location
$capacity = 1
$skuName = "PC2"
$tier = "PremiumContainer"

try
{
#Setup
New-AzureRmResourceGroup -Name $rgname -Location $location

# Test
$job = New-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $whpName -Location $location -Tier $tier -WorkerSize Small -HyperV -AsJob
$job | Wait-Job
$createResult = $job | Receive-Job

# Assert
Assert-AreEqual $whpName $createResult.Name
Assert-AreEqual $tier $createResult.Sku.Tier
Assert-AreEqual $skuName $createResult.Sku.Name
Assert-AreEqual $capacity $createResult.Sku.Capacity

# Assert

$getResult = Get-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $whpName
Assert-AreEqual $whpName $getResult.Name
Assert-AreEqual PremiumContainer $getResult.Sku.Tier
Assert-AreEqual $skuName $getResult.Sku.Name
Assert-AreEqual $capacity $getResult.Sku.Capacity
Assert-AreEqual $true $getResult.IsXenon
Assert-AreEqual "xenon" $getResult.Kind

}
finally
{
# Cleanup
Remove-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $whpName -Force
Remove-AzureRmResourceGroup -Name $rgname -Force
}
}


<#
.SYNOPSIS
Tests creating a new Web Hosting Plan.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void TestGetDeletedWebApp()
WebsitesController.NewInstance.RunPsTest(_logger, "Test-GetDeletedWebApp");
}

[Fact]
[Fact(Skip = "Needs re-recorded, Restore tests use prior webapp state on the subscription")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRestoreDeletedWebAppToExisting()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public void TestCreateNewWebApp()
WebsitesController.NewInstance.RunPsTest(_logger, "Test-CreateNewWebApp");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateNewWebAppHyperV()
{
WebsitesController.NewInstance.RunPsTest(_logger, "Test-CreateNewWebAppHyperV");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateNewAppOnAse()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,75 @@ function Test-CreateNewWebApp
}
}

<#
.SYNOPSIS
Tests creating a new windows continer app.
.DESCRIPTION
SmokeTest
#>
function Test-CreateNewWebAppHyperV
{
# Setup
$rgname = Get-ResourceGroupName
$wname = Get-WebsiteName
$location = Get-WebLocation
$whpName = Get-WebHostPlanName
$tier = "PremiumContainer"
$apiversion = "2015-08-01"
$resourceType = "Microsoft.Web/sites"
$containerImageName = "testcontainer.io/paltest/iis"
$containerRegistryUrl = "https://testcontainer.azurecr.io"
$ontainerRegistryUser = "testregistry"
$pass = "7Dxo9p79Ins2K3ZU"
$containerRegistryPassword = ConvertTo-SecureString -String $pass -AsPlainText -Force
$dockerPrefix = "DOCKER|"


try
{
#Setup
New-AzureRmResourceGroup -Name $rgname -Location $location
$serverFarm = New-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $whpName -Location $location -Tier $tier -WorkerSize Small -HyperV

# Create new web app
$job = New-AzureRmWebApp -ResourceGroupName $rgname -Name $wname -Location $location -AppServicePlan $whpName -ContainerImageName $containerImageName -ContainerRegistryUrl $containerRegistryUrl -ContainerRegistryUser $ontainerRegistryUser -ContainerRegistryPassword $containerRegistryPassword -AsJob
$job | Wait-Job
$actual = $job | Receive-Job

# Assert
Assert-AreEqual $wname $actual.Name
Assert-AreEqual $serverFarm.Id $actual.ServerFarmId

# Get new web app
$result = Get-AzureRmWebApp -ResourceGroupName $rgname -Name $wname

# Assert
Assert-AreEqual $wname $result.Name
Assert-AreEqual $serverFarm.Id $result.ServerFarmId
Assert-AreEqual $true $result.IsXenon
Assert-AreEqual ($dockerPrefix + $containerImageName) $result.SiteConfig.WindowsFxVersion

$appSettings = @{
"DOCKER_REGISTRY_SERVER_URL" = $containerRegistryUrl;
"DOCKER_REGISTRY_SERVER_USERNAME" = $ontainerRegistryUser;
"DOCKER_REGISTRY_SERVER_PASSWORD" = $pass;}

foreach($nvp in $webApp.SiteConfig.AppSettings)
{
Assert-True { $appSettings.Keys -contains $nvp.Name }
Assert-True { $appSettings[$nvp.Name] -match $nvp.Value }
}


}
finally
{
# Cleanup
Remove-AzureRmWebApp -ResourceGroupName $rgname -Name $wname -Force
Remove-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $whpName -Force
Remove-AzureRmResourceGroup -Name $rgname -Force
}
}
<#
.SYNOPSIS
Tests creating a new website on an ase
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading