-
Notifications
You must be signed in to change notification settings - Fork 4k
Fixes:5181: Set-AzureRmAppServicePlan errors out for a Premium V2 App #5286
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
Fixes:5181: Set-AzureRmAppServicePlan errors out for a Premium V2 App #5286
Conversation
@@ -58,7 +58,7 @@ public override void ExecuteCmdlet() | |||
AppServicePlan = WebsitesClient.GetAppServicePlan(ResourceGroupName, Name); | |||
AppServicePlan.Sku.Tier = string.IsNullOrWhiteSpace(Tier) ? AppServicePlan.Sku.Tier : Tier; | |||
AppServicePlan.Sku.Capacity = NumberofWorkers > 0 ? NumberofWorkers : AppServicePlan.Sku.Capacity; | |||
var workerSizeAsNumber = int.Parse(AppServicePlan.Sku.Name.Substring(1, AppServicePlan.Sku.Name.Length - 1)); | |||
var workerSizeAsNumber = int.Parse(Regex.Match(AppServicePlan.Sku.Name, @"\d+").Value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid issues in the future, what if no digit value is found, seems like there should be a default value in this case.
Also, can you add some regression automation for this scenario? If you have verified locally, you can file an issue for test automation in a near term sprint. Please either add the test automation or link the test issue here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an issue to track adding a test here #5287
Test debt issue here: #5287 |
Service plans
Description
With addition to Premium V2 the SKU name is 'P1V2' & son on instead of just P1 Or S1. The Parsing logic that tries to generate the workersize number from the SKU name wasn't handling this correctly
#5181
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThru
parameter.Cmdlet Parameter Guidelines