use of com.microsoft.azure.toolkit.lib.appservice.webapp.WebApp in project azure-gradle-plugins by microsoft.
the class DeployTask method createOrUpdateWebapp.
private WebAppBase<?, ?, ?> createOrUpdateWebapp(GradleWebAppConfig config) {
final AppServiceConfig appServiceConfig = convert(config);
final WebApp app = Azure.az(AzureWebApp.class).webApps(appServiceConfig.subscriptionId()).get(appServiceConfig.resourceGroup(), appServiceConfig.appName());
boolean skipCreate = BooleanUtils.toBoolean(System.getProperty("azure.resource.create.skip", "false"));
final AppServiceConfig defaultConfig = app != null && app.exists() ? fromAppService(app, Objects.requireNonNull(app.getAppServicePlan())) : buildDefaultConfig(appServiceConfig.subscriptionId(), appServiceConfig.resourceGroup(), appServiceConfig.appName());
mergeAppServiceConfig(appServiceConfig, defaultConfig);
if (appServiceConfig.pricingTier() == null) {
appServiceConfig.pricingTier(StringUtils.containsIgnoreCase(Objects.toString(appServiceConfig.runtime().webContainer()), "jboss") ? PricingTier.PREMIUM_P1V3 : PricingTier.PREMIUM_P1V2);
}
CreateOrUpdateWebAppTask task = new CreateOrUpdateWebAppTask(appServiceConfig);
task.setSkipCreateAzureResource(skipCreate);
return task.execute();
}
Aggregations