-
Notifications
You must be signed in to change notification settings - Fork 165
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
Provide API createWebAppOnLinux to create web apps on linux #1963
Conversation
|
||
AppServicePlan.DefinitionStages.WithPricingTier withPricingTier; | ||
String resourceGroup = model.getResourceGroup(); | ||
if (isCreatingNewResourceGroup) { |
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.
Move boolean isCreatingNewResourceGroup = model.isCreatingResGrp();
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.
Remove the variable declaration since it is used only once, check model.isCreatingResGrp()
directly
AppServicePlan.DefinitionStages.WithPricingTier withPricingTier; | ||
String resourceGroup = model.getResourceGroup(); | ||
if (isCreatingNewResourceGroup) { | ||
withPricingTier = withGroup.withNewResourceGroup(resourceGroup); |
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.
Is it possible to check if the resource group exists or not?
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.
Will check and handle it during validation in next PR
return appWithGroup.withExistingResourceGroup(resourceGroup).withNewWindowsPlan(withCreatePlan); | ||
} | ||
|
||
private WebApp.DefinitionStages.WithDockerContainerImage withCreateNewLinuxServicePlan( |
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.
Duplicated codes compared with withCreateNewWindowsServicePlan().
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.
Use helper methods to handle the duplicated codes.
@@ -48,6 +50,8 @@ | |||
private String region = ""; | |||
private String pricing = ""; | |||
private JavaVersion jdkVersion = JavaVersion.JAVA_8_NEWEST; | |||
private RuntimeStack linuxRuntime = RuntimeStack.TOMCAT_8_5_JRE8; | |||
private OperatingSystem os; |
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.
Why not assign a default value for consistency?
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.
@Matthew-Dong Any suggestions for the default value? Linux or Windows?
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.
I see every function throws Exception
. Does SDK simply throws Exception
, or do we swallow the type of exceptions?
@Eskibear final String[] tierSize = model.getPricing().split("_");
if (tierSize.length != 2) {
throw new Exception("Cannot get valid price tier");
} |
Suggest to create an issue for using customized Error type instead of the general |
Fix the issue #1971
Use help methods
prepareWithCreate
andprepareServicePlan
to handle duplicate codes during creating a new Windows or Linux service plan.Add new API
createWebAppOnLinux
.