Search in sources :

Example 1 with WebAppEntity

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"));
    }
}
Also used : WebAppEntity(com.microsoft.azure.toolkit.lib.appservice.entity.WebAppEntity) AzureExecutionException(com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) IWebApp(com.microsoft.azure.toolkit.lib.appservice.service.IWebApp)

Aggregations

WebAppEntity (com.microsoft.azure.toolkit.lib.appservice.entity.WebAppEntity)1 IWebApp (com.microsoft.azure.toolkit.lib.appservice.service.IWebApp)1 AzureExecutionException (com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1