diff --git a/src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.cs b/src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.cs index 3ed73ac1bd84..25c596e4823c 100644 --- a/src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.cs +++ b/src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.cs @@ -45,6 +45,13 @@ public void TestCreateNewAppServicePlanHyperV() WebsitesController.NewInstance.RunPsTest(_logger, "Test-CreateNewAppServicePlanHyperV"); } + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestCreateNewAppServicePlanLinux() + { + WebsitesController.NewInstance.RunPsTest(_logger, "Test-CreateNewAppServicePlanLinux"); + } + [Fact] [Trait(Category.AcceptanceType, Category.CheckIn)] public void TestSetAppServicePlan() diff --git a/src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.ps1 b/src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.ps1 index 760e773aa0d3..b0c83374563d 100644 --- a/src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.ps1 +++ b/src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.ps1 @@ -57,7 +57,6 @@ function Test-CreateNewAppServicePlan Remove-AzResourceGroup -Name $rgname -Force } } - <# .SYNOPSIS Tests creating a new Web Hosting Plan with HyperV container. @@ -108,6 +107,55 @@ function Test-CreateNewAppServicePlanHyperV } +<# +.SYNOPSIS +Tests creating a new Web Hosting Plan with Linux +#> +function Test-CreateNewAppServicePlanLinux +{ + # Setup + $rgname = Get-ResourceGroupName + $whpName = Get-WebHostPlanName + $location = Get-Location + $capacity = 1 + $skuName = "B1" + $tier = "Basic" + + try + { + #Setup + New-AzResourceGroup -Name $rgname -Location $location + + # Test + $job = New-AzAppServicePlan -ResourceGroupName $rgname -Name $whpName -Location $location -Tier $tier -WorkerSize Small -Linux -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-AzAppServicePlan -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.Reserved + Assert-AreEqual "Linux" $getResult.Kind + + } + finally + { + # Cleanup + Remove-AzAppServicePlan -ResourceGroupName $rgname -Name $whpName -Force + Remove-AzResourceGroup -Name $rgname -Force + } +} + <# .SYNOPSIS Tests creating a new Web Hosting Plan. diff --git a/src/Websites/Websites.sln b/src/Websites/Websites.sln index b8cdd1848e89..7ca4fcc30841 100644 --- a/src/Websites/Websites.sln +++ b/src/Websites/Websites.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2042 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30002.166 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Websites", "Websites\Websites.csproj", "{80A92297-7C92-456B-8EE7-9FB6CE30149D}" EndProject diff --git a/src/Websites/Websites/ChangeLog.md b/src/Websites/Websites/ChangeLog.md index e918c5d41fdf..97a4dd8d3a96 100644 --- a/src/Websites/Websites/ChangeLog.md +++ b/src/Websites/Websites/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Added Linux support parameter for New-AzAppServicePlan * Added "SourceWebApp.Location" for `New-AzWebApp` and `New-AzWebAppSlot` ## Version 1.9.0 diff --git a/src/Websites/Websites/Cmdlets/AppServicePlans/NewAzureAppServicePlan.cs b/src/Websites/Websites/Cmdlets/AppServicePlans/NewAzureAppServicePlan.cs index ef5aa5a3da4a..4200c6f1ba8c 100644 --- a/src/Websites/Websites/Cmdlets/AppServicePlans/NewAzureAppServicePlan.cs +++ b/src/Websites/Websites/Cmdlets/AppServicePlans/NewAzureAppServicePlan.cs @@ -68,6 +68,9 @@ public class NewAzureAppServicePlanCmdlet : AppServicePlanBaseCmdlet [Parameter(ParameterSetName = ParameterSet1Name, Mandatory = false, HelpMessage = "Tags are name/value pairs that enable you to categorize resources")] public Hashtable Tag { get; set; } + [Parameter(ParameterSetName = ParameterSet1Name, Mandatory = false)] + public SwitchParameter Linux { get; set; } + public override void ExecuteCmdlet() { if (HyperV.IsPresent && Tier != "PremiumContainer") @@ -113,7 +116,8 @@ public override void ExecuteCmdlet() Sku = sku, PerSiteScaling = PerSiteScaling, IsXenon = HyperV.IsPresent, - Tags= (IDictionary)CmdletHelpers.ConvertToStringDictionary(Tag) + Tags= (IDictionary)CmdletHelpers.ConvertToStringDictionary(Tag), + Reserved = Linux.IsPresent }; AppServicePlan retPlan = WebsitesClient.CreateOrUpdateAppServicePlan(ResourceGroupName, Name, appServicePlan, AseName, aseResourceGroupName); diff --git a/src/Websites/Websites/Websites.csproj b/src/Websites/Websites/Websites.csproj index 101d911e37d4..037e2f0948b2 100644 --- a/src/Websites/Websites/Websites.csproj +++ b/src/Websites/Websites/Websites.csproj @@ -8,6 +8,7 @@ $(LegacyAssemblyPrefix)WebApps + netstandard2.0 diff --git a/src/Websites/Websites/help/New-AzAppServicePlan.md b/src/Websites/Websites/help/New-AzAppServicePlan.md index 015d257e781f..5bf3164b7866 100644 --- a/src/Websites/Websites/help/New-AzAppServicePlan.md +++ b/src/Websites/Websites/help/New-AzAppServicePlan.md @@ -16,9 +16,9 @@ Creates an Azure App Service plan in a given Geo location. ### S1 ``` New-AzAppServicePlan [-Location] [[-Tier] ] [[-NumberofWorkers] ] - [[-WorkerSize] ] [[-AseName] ] [[-AseResourceGroupName] ] [-PerSiteScaling ] - [-HyperV] [-AsJob] [-ResourceGroupName] [-Name] [-DefaultProfile ] - [] + [[-WorkerSize] ] [[-AseName] ] [[-AseResourceGroupName] ] [-PerSiteScaling ] + [-HyperV] [-Linux] [-AsJob] [-ResourceGroupName] [-Name] [-DefaultProfile ] + [] ``` ### S2 @@ -133,6 +133,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` + +### -Linux +Specify this, App Service Plan will run Linux Contaianers + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: S1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Location Location