Skip to content

Commit 34b22e2

Browse files
Git #11895 and #5983 (#12127)
1 parent 8f3a434 commit 34b22e2

File tree

8 files changed

+28460
-757
lines changed

8 files changed

+28460
-757
lines changed

src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ public void TestCreateNewAppServicePlanHyperV()
4545
WebsitesController.NewInstance.RunPsTest(_logger, "Test-CreateNewAppServicePlanHyperV");
4646
}
4747

48+
[Fact]
49+
[Trait(Category.AcceptanceType, Category.CheckIn)]
50+
public void TestCreateNewAppServicePlanLinux()
51+
{
52+
WebsitesController.NewInstance.RunPsTest(_logger, "Test-CreateNewAppServicePlanLinux");
53+
}
54+
4855
[Fact]
4956
[Trait(Category.AcceptanceType, Category.CheckIn)]
5057
public void TestSetAppServicePlan()

src/Websites/Websites.Test/ScenarioTests/AppServicePlanTests.ps1

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,55 @@ function Test-CreateNewAppServicePlanHyperV
108108
}
109109

110110

111+
<#
112+
.SYNOPSIS
113+
Tests creating a new Web Hosting Plan with Linux
114+
#>
115+
function Test-CreateNewAppServicePlanLinux
116+
{
117+
# Setup
118+
$rgname = Get-ResourceGroupName
119+
$whpName = Get-WebHostPlanName
120+
$location = Get-Location
121+
$capacity = 1
122+
$skuName = "B1"
123+
$tier = "Basic"
124+
125+
try
126+
{
127+
#Setup
128+
New-AzResourceGroup -Name $rgname -Location $location
129+
130+
# Test
131+
$job = New-AzAppServicePlan -ResourceGroupName $rgname -Name $whpName -Location $location -Tier $tier -WorkerSize Small -Linux -AsJob
132+
$job | Wait-Job
133+
$createResult = $job | Receive-Job
134+
135+
# Assert
136+
Assert-AreEqual $whpName $createResult.Name
137+
Assert-AreEqual $tier $createResult.Sku.Tier
138+
Assert-AreEqual $skuName $createResult.Sku.Name
139+
Assert-AreEqual $capacity $createResult.Sku.Capacity
140+
141+
# Assert
142+
143+
$getResult = Get-AzAppServicePlan -ResourceGroupName $rgname -Name $whpName
144+
Assert-AreEqual $whpName $getResult.Name
145+
Assert-AreEqual $tier $getResult.Sku.Tier
146+
Assert-AreEqual $skuName $getResult.Sku.Name
147+
Assert-AreEqual $capacity $getResult.Sku.Capacity
148+
Assert-AreEqual $true $getResult.Reserved
149+
Assert-AreEqual "Linux" $getResult.Kind
150+
151+
}
152+
finally
153+
{
154+
# Cleanup
155+
Remove-AzAppServicePlan -ResourceGroupName $rgname -Name $whpName -Force
156+
Remove-AzResourceGroup -Name $rgname -Force
157+
}
158+
}
159+
111160
<#
112161
.SYNOPSIS
113162
Tests creating a new Web Hosting Plan.

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AppServicePlanTests/TestCreateNewAppServicePlanLinux.json

Lines changed: 628 additions & 0 deletions
Large diffs are not rendered by default.

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests/TestGetWebApp.json

Lines changed: 27767 additions & 755 deletions
Large diffs are not rendered by default.

src/Websites/Websites/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* Added safeguard to delete created webapp if restore failed in `Restore-AzDeletedWebApp`
2222
* Added "SourceWebApp.Location" for `New-AzWebApp` and `New-AzWebAppSlot`
2323
* Fixed bug that prevented changing Container settings in `Set-AzWebApp` and `Set-AzWebAppSlot`
24+
* Fixed bug to get SiteConfig when -Name is not given for Get-AzWebApp
25+
* Added a support to create ASP for Linux Apps
2426

2527
## Version 1.9.0
2628
* Fixed typo on help of `Update-AzWebAppAccessRestrictionConfig`.

src/Websites/Websites/Cmdlets/AppServicePlans/NewAzureAppServicePlan.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ public class NewAzureAppServicePlanCmdlet : AppServicePlanBaseCmdlet
6868
[Parameter(ParameterSetName = ParameterSet1Name, Mandatory = false, HelpMessage = "Tags are name/value pairs that enable you to categorize resources")]
6969
public Hashtable Tag { get; set; }
7070

71+
[Parameter(ParameterSetName = ParameterSet1Name, Mandatory = false)]
72+
public SwitchParameter Linux { get; set; }
73+
7174
public override void ExecuteCmdlet()
7275
{
7376
if (HyperV.IsPresent && Tier != "PremiumContainer")
@@ -113,7 +116,8 @@ public override void ExecuteCmdlet()
113116
Sku = sku,
114117
PerSiteScaling = PerSiteScaling,
115118
IsXenon = HyperV.IsPresent,
116-
Tags= (IDictionary<string, string>)CmdletHelpers.ConvertToStringDictionary(Tag)
119+
Tags= (IDictionary<string, string>)CmdletHelpers.ConvertToStringDictionary(Tag),
120+
Reserved = Linux.IsPresent
117121
};
118122

119123
AppServicePlan retPlan = WebsitesClient.CreateOrUpdateAppServicePlan(ResourceGroupName, Name, appServicePlan, AseName, aseResourceGroupName);

src/Websites/Websites/Cmdlets/WebApps/GetAzureWebApp.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ private void GetByResourceGroup()
127127
{
128128
foreach (var item in result)
129129
{
130+
WebsitesClient.GetWebAppConfiguration(ResourceGroupName, item.Name, null, item);
130131
list.Add(new PSSite(item));
131132

132133
}

src/Websites/Websites/Utilities/WebsitesClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ public void UpdateWebAppConfiguration(string resourceGroupName, string location,
610610
}
611611
}
612612

613-
private void GetWebAppConfiguration(string resourceGroupName, string webSiteName, string slotName, Site site)
613+
public void GetWebAppConfiguration(string resourceGroupName, string webSiteName, string slotName, Site site)
614614
{
615615
string qualifiedSiteName;
616616
var useSlot = CmdletHelpers.ShouldUseDeploymentSlot(webSiteName, slotName, out qualifiedSiteName);

0 commit comments

Comments
 (0)