use of com.microsoft.azure.toolkit.lib.appservice.AzureAppService in project azure-tools-for-java by Microsoft.
the class AzureWebAppMvpModel method getOrCreateAppServicePlan.
private IAppServicePlan getOrCreateAppServicePlan(AppServicePlanEntity servicePlanEntity) {
final AzureAppService az = getAzureAppServiceClient(servicePlanEntity.getSubscriptionId());
final IAppServicePlan appServicePlan = az.appServicePlan(servicePlanEntity);
if (appServicePlan.exists()) {
return appServicePlan;
}
return appServicePlan.create().withName(servicePlanEntity.getName()).withResourceGroup(servicePlanEntity.getResourceGroup()).withRegion(com.microsoft.azure.toolkit.lib.common.model.Region.fromName(servicePlanEntity.getRegion())).withPricingTier(servicePlanEntity.getPricingTier()).withOperatingSystem(servicePlanEntity.getOperatingSystem()).commit();
}
use of com.microsoft.azure.toolkit.lib.appservice.AzureAppService in project azure-tools-for-java by Microsoft.
the class WebAppRunState method getOrCreateDeployTargetFromAppSettingModel.
@NotNull
private IWebAppBase getOrCreateDeployTargetFromAppSettingModel(@NotNull RunProcessHandler processHandler) throws Exception {
final AzureAppService azureAppService = AzureWebAppMvpModel.getInstance().getAzureAppServiceClient(webAppSettingModel.getSubscriptionId());
final IWebApp webApp = getOrCreateWebappFromAppSettingModel(azureAppService, processHandler);
if (!isDeployToSlot()) {
return webApp;
}
// todo: add new boolean indicator instead of comparing string values
if (StringUtils.equals(webAppSettingModel.getSlotName(), Constants.CREATE_NEW_SLOT)) {
return createDeploymentSlot(webApp, processHandler);
} else {
return webApp.deploymentSlot(webAppSettingModel.getSlotName());
}
}
Aggregations