Skip to content

Commit

Permalink
Merge pull request #6982 from microsoft/hanli-fixes-202209
Browse files Browse the repository at this point in the history
Reset function draft after creation, in case app settings could not be load correctly
  • Loading branch information
Flanker32 authored Sep 30, 2022
2 parents d6fc5f2 + 52f5d49 commit 3ef1d28
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 3ef1d28

Please sign in to comment.