Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
49 changes: 49 additions & 0 deletions src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,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 $tier $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.
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/Websites/Websites/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* Added safeguard to delete created webapp if restore failed in `Restore-AzDeletedWebApp`
* Added "SourceWebApp.Location" for `New-AzWebApp` and `New-AzWebAppSlot`
* Fixed bug that prevented changing Container settings in `Set-AzWebApp` and `Set-AzWebAppSlot`
* Fixed bug to get SiteConfig when -Name is not given for Get-AzWebApp
* Added a support to create ASP for Linux Apps

## Version 1.9.0
* Fixed typo on help of `Update-AzWebAppAccessRestrictionConfig`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -113,7 +116,8 @@ public override void ExecuteCmdlet()
Sku = sku,
PerSiteScaling = PerSiteScaling,
IsXenon = HyperV.IsPresent,
Tags= (IDictionary<string, string>)CmdletHelpers.ConvertToStringDictionary(Tag)
Tags= (IDictionary<string, string>)CmdletHelpers.ConvertToStringDictionary(Tag),
Reserved = Linux.IsPresent
};

AppServicePlan retPlan = WebsitesClient.CreateOrUpdateAppServicePlan(ResourceGroupName, Name, appServicePlan, AseName, aseResourceGroupName);
Expand Down
1 change: 1 addition & 0 deletions src/Websites/Websites/Cmdlets/WebApps/GetAzureWebApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private void GetByResourceGroup()
{
foreach (var item in result)
{
WebsitesClient.GetWebAppConfiguration(ResourceGroupName, item.Name, null, item);
list.Add(new PSSite(item));

}
Expand Down
2 changes: 1 addition & 1 deletion src/Websites/Websites/Utilities/WebsitesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public void UpdateWebAppConfiguration(string resourceGroupName, string location,
}
}

private void GetWebAppConfiguration(string resourceGroupName, string webSiteName, string slotName, Site site)
public void GetWebAppConfiguration(string resourceGroupName, string webSiteName, string slotName, Site site)
{
string qualifiedSiteName;
var useSlot = CmdletHelpers.ShouldUseDeploymentSlot(webSiteName, slotName, out qualifiedSiteName);
Expand Down