use of com.microsoft.azure.toolkit.lib.appservice.entity.WebAppEntity in project azure-tools-for-java by Microsoft.
the class WebAppRunState method getOrCreateWebappFromAppSettingModel.
private IWebApp getOrCreateWebappFromAppSettingModel(AzureAppService azureAppService, RunProcessHandler processHandler) throws Exception {
final WebAppEntity entity = WebAppEntity.builder().id(webAppSettingModel.getWebAppId()).subscriptionId(webAppSettingModel.getSubscriptionId()).resourceGroup(webAppSettingModel.getResourceGroup()).name(webAppSettingModel.getWebAppName()).build();
final IWebApp webApp = azureAppService.webapp(entity);
if (webApp.exists()) {
return webApp;
}
if (webAppSettingModel.isCreatingNew()) {
processHandler.setText(message("webapp.deploy.hint.creatingWebApp"));
return AzureWebAppMvpModel.getInstance().createWebAppFromSettingModel(webAppSettingModel);
} else {
processHandler.setText(message("appService.deploy.hint.failed"));
throw new Exception(message("webapp.deploy.error.noWebApp"));
}
}
Aggregations