Skip to content

Commit 65a2dbf

Browse files
authored
Merge pull request #305 from LukaszStem/preview
Adding PremiumV2 Sku for App Service Plans
2 parents fe0f8ec + 42fbdb0 commit 65a2dbf

File tree

6 files changed

+1349
-177
lines changed

6 files changed

+1349
-177
lines changed

src/ResourceManager/Websites/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Add PremiumV2 Tier for App Service Plans
2122

2223
## Version 3.3.1
2324

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ function Test-SetAppServicePlan
7070
$capacity = 0
7171
$perSiteScaling = $false;
7272

73-
$newTier ="Standard"
74-
$newSkuName = "S2"
73+
$newTier ="PremiumV2"
74+
$newSkuName = "P2v2"
7575
$newWorkerSize = "Medium"
7676
$newCapacity = 2
7777
$newPerSiteScaling = $true;

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

Lines changed: 1332 additions & 171 deletions
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public class NewAzureAppServicePlanCmdlet : AppServicePlanBaseCmdlet
3232
[ValidateNotNullOrEmpty]
3333
public string Location { get; set; }
3434

35-
[Parameter(Position = 3, Mandatory = false, HelpMessage = "The App Service plan tier. Allowed values are [Free|Shared|Basic|Standard|Premium]")]
36-
[ValidateSet("Free", "Shared", "Basic", "Standard", "Premium", IgnoreCase = true)]
35+
[Parameter(Position = 3, Mandatory = false, HelpMessage = "The App Service plan tier. Allowed values are [Free|Shared|Basic|Standard|Premium|PremiumV2]")]
36+
[ValidateSet("Free", "Shared", "Basic", "Standard", "Premium", "PremiumV2", IgnoreCase = true)]
3737
public string Tier { get; set; }
3838

3939
[Parameter(Position = 4, Mandatory = false, HelpMessage = "Number of Workers to be allocated.")]

src/ResourceManager/Websites/Commands.Websites/Cmdlets/AppServicePlans/SetAzureAppServicePlan.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public class SetAzureAppServicePlanCmdlet : AppServicePlanBaseCmdlet
3131
[ValidateNotNullOrEmpty]
3232
public string AdminSiteName { get; set; }
3333

34-
[Parameter(ParameterSetName = ParameterSet1Name, Position = 3, Mandatory = false, HelpMessage = "The App Service plan tier. Allowed values are [Free|Shared|Basic|Standard|Premium]")]
35-
[ValidateSet("Free", "Shared", "Basic", "Standard", "Premium", IgnoreCase = true)]
34+
[Parameter(ParameterSetName = ParameterSet1Name, Position = 3, Mandatory = false, HelpMessage = "The App Service plan tier. Allowed values are [Free|Shared|Basic|Standard|Premium|PremiumV2]")]
35+
[ValidateSet("Free", "Shared", "Basic", "Standard", "Premium", "PremiumV2", IgnoreCase = true)]
3636
public string Tier { get; set; }
3737

3838
[Parameter(ParameterSetName = ParameterSet1Name, Position = 4, Mandatory = false, HelpMessage = "Number of Workers to be allocated.")]

src/ResourceManager/Websites/Commands.Websites/Utilities/CmdletHelpers.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ internal static string GetSkuName(string tier, int workerSize)
191191
{
192192
sku = "D";
193193
}
194+
else if (string.Equals("PremiumV2", tier, StringComparison.OrdinalIgnoreCase))
195+
{
196+
sku = "P" + workerSize + "V2";
197+
return sku;
198+
}
194199
else
195200
{
196201
sku = string.Empty + tier[0];
@@ -207,6 +212,11 @@ internal static string GetSkuName(string tier, string workerSize)
207212
{
208213
sku = "D";
209214
}
215+
else if (string.Equals("PremiumV2", tier, StringComparison.OrdinalIgnoreCase))
216+
{
217+
sku = "P" + WorkerSizes[workerSize] + "V2";
218+
return sku;
219+
}
210220
else
211221
{
212222
sku = string.Empty + tier[0];

0 commit comments

Comments
 (0)