Skip to content

Commit

Permalink
Reset function draft after creation, in case app settings could not b…
Browse files Browse the repository at this point in the history
…e load correctly
  • Loading branch information
Flanker32 committed Sep 29, 2022
1 parent 903e0fe commit 52f5d49
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 52f5d49

Please sign in to comment.