Skip to content

Adding support for Premium V3 tier #12869

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 2 commits into from
Sep 9, 2020
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
1 change: 1 addition & 0 deletions src/Websites/Websites/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Added support for Premium V3 pricing tier

## Version 1.11.0
* Added support to perform operations for Slots not in the same resource group as the App Service Plan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class NewAzureAppServicePlanCmdlet : AppServicePlanBaseCmdlet
[ValidateNotNullOrEmpty]
public string Location { get; set; }

[Parameter(Position = 3, Mandatory = false, HelpMessage = "The App Service plan tier. Allowed values are [Free|Shared|Basic|Standard|Premium|PremiumV2]")]
[PSArgumentCompleter("Free", "Shared", "Basic", "Standard", "Premium", "PremiumV2", "Isolated", "PremiumContainer")]
[Parameter(Position = 3, Mandatory = false, HelpMessage = "The App Service plan tier. Allowed values are [Free|Shared|Basic|Standard|Premium|PremiumV2|PremiumV3]")]
[PSArgumentCompleter("Free", "Shared", "Basic", "Standard", "Premium", "PremiumV2", "PremiumV3", "Isolated", "PremiumContainer")]
public string Tier { get; set; }

[Parameter(Position = 4, Mandatory = false, HelpMessage = "Number of Workers to be allocated.")]
Expand Down Expand Up @@ -73,9 +73,10 @@ public class NewAzureAppServicePlanCmdlet : AppServicePlanBaseCmdlet

public override void ExecuteCmdlet()
{
if (HyperV.IsPresent && Tier != "PremiumContainer")
if (HyperV.IsPresent &&
(Tier != "PremiumContainer" && Tier != "PremiumV3"))
{
throw new Exception("HyperV switch is only allowed for PremiumContainer tier");
throw new Exception("HyperV switch is only allowed for PremiumContainer or PremiumV3 tiers");
}
if (!HyperV.IsPresent && Tier == "PremiumContainer")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class SetAzureAppServicePlanCmdlet : AppServicePlanBaseCmdlet
[ValidateNotNullOrEmpty]
public string AdminSiteName { get; set; }

[Parameter(ParameterSetName = ParameterSet1Name, Position = 3, Mandatory = false, HelpMessage = "The App Service plan tier. Allowed values are [Free|Shared|Basic|Standard|Premium|PremiumV2]")]
[PSArgumentCompleter("Free", "Shared", "Basic", "Standard", "Premium", "PremiumV2", "Isolated")]
[Parameter(ParameterSetName = ParameterSet1Name, Position = 3, Mandatory = false, HelpMessage = "The App Service plan tier. Allowed values are [Free|Shared|Basic|Standard|Premium|PremiumV2|PremiumV3]")]
[PSArgumentCompleter("Free", "Shared", "Basic", "Standard", "Premium", "PremiumV2", "PremiumV3", "Isolated")]
public string Tier { get; set; }

[Parameter(ParameterSetName = ParameterSet1Name, Position = 4, Mandatory = false, HelpMessage = "Number of Workers to be allocated.")]
Expand Down
10 changes: 10 additions & 0 deletions src/Websites/Websites/Utilities/CmdletHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ internal static string GetSkuName(string tier, int workerSize)
sku = "P" + workerSize + "V2";
return sku;
}
else if (string.Equals("PremiumV3", tier, StringComparison.OrdinalIgnoreCase))
{
sku = "P" + workerSize + "V3";
return sku;
}
else if (string.Equals("PremiumContainer", tier, StringComparison.OrdinalIgnoreCase))
{
sku = "PC" + (workerSize + 1);
Expand All @@ -313,6 +318,11 @@ internal static string GetSkuName(string tier, string workerSize)
sku = "P" + WorkerSizes[workerSize] + "V2";
return sku;
}
else if (string.Equals("PremiumV3", tier, StringComparison.OrdinalIgnoreCase))
{
sku = "P" + WorkerSizes[workerSize] + "V3";
return sku;
}
else if (string.Equals("PremiumContainer", tier, StringComparison.OrdinalIgnoreCase))
{
sku = "PC" + (WorkerSizes[workerSize] + 1);
Expand Down