From 52f5d499cc2e2c9d57cc828a23bfc3ac03e95d0f Mon Sep 17 00:00:00 2001 From: Hanxiao Liu Date: Thu, 29 Sep 2022 23:55:37 +0800 Subject: [PATCH] Reset function draft after creation, in case app settings could not be load correctly --- .../toolkit/lib/legacy/function/FunctionAppService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/FunctionAppService.java b/PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/FunctionAppService.java index f48eab076a..be93cdefb5 100644 --- a/PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/FunctionAppService.java +++ b/PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/FunctionAppService.java @@ -16,6 +16,7 @@ import com.microsoft.azure.toolkit.lib.appservice.model.Runtime; import com.microsoft.azure.toolkit.lib.appservice.task.CreateOrUpdateFunctionAppTask; import com.microsoft.azure.toolkit.lib.appservice.task.DeployFunctionAppTask; +import com.microsoft.azure.toolkit.lib.common.model.AzResource; import com.microsoft.azure.toolkit.lib.resource.ResourceGroupConfig; import org.apache.commons.lang3.StringUtils; @@ -50,7 +51,11 @@ public FunctionAppConfig getFunctionAppConfigFromExistingFunction(@Nonnull final public FunctionAppBase createOrUpdateFunctionApp(final FunctionAppConfig config) { final CreateOrUpdateFunctionAppTask task = new CreateOrUpdateFunctionAppTask(convertToTaskConfig(config)); - return task.execute(); + final FunctionAppBase execute = task.execute(); + if (execute instanceof AzResource.Draft) { + ((AzResource.Draft) execute).reset(); + } + return execute; } private com.microsoft.azure.toolkit.lib.appservice.config.FunctionAppConfig convertToTaskConfig(final FunctionAppConfig config) {