|
33 | 33 | import com.microsoft.intellij.RunProcessHandler; |
34 | 34 | import lombok.RequiredArgsConstructor; |
35 | 35 | import org.apache.commons.collections4.CollectionUtils; |
| 36 | +import org.apache.commons.collections4.MapUtils; |
36 | 37 | import org.apache.commons.lang.StringUtils; |
37 | 38 | import org.jetbrains.annotations.NotNull; |
38 | 39 | import org.jetbrains.annotations.Nullable; |
@@ -90,6 +91,7 @@ public IFunctionApp executeSteps(@NotNull RunProcessHandler processHandler, @Not |
90 | 91 | } else { |
91 | 92 | functionApp = Azure.az(AzureAppService.class).subscription(functionDeployConfiguration.getSubscriptionId()) |
92 | 93 | .functionApp(functionDeployConfiguration.getFunctionId()); |
| 94 | + updateApplicationSettings(functionApp); |
93 | 95 | } |
94 | 96 | stagingFolder = FunctionUtils.getTempStagingFolder(); |
95 | 97 | prepareStagingFolder(stagingFolder, processHandler, operation); |
@@ -122,6 +124,16 @@ private IFunctionApp createFunctionApp(@NotNull RunProcessHandler processHandler |
122 | 124 | return functionApp; |
123 | 125 | } |
124 | 126 |
|
| 127 | + private void updateApplicationSettings(IFunctionApp deployTarget) { |
| 128 | + final Map<String, String> applicationSettings = functionDeployConfiguration.getAppSettings(); |
| 129 | + if (MapUtils.isEmpty(applicationSettings)) { |
| 130 | + return; |
| 131 | + } |
| 132 | + AzureMessager.getMessager().info("Updating application settings..."); |
| 133 | + deployTarget.update().withAppSettings(applicationSettings).commit(); |
| 134 | + AzureMessager.getMessager().info("Update application settings successfully."); |
| 135 | + } |
| 136 | + |
125 | 137 | @AzureOperation( |
126 | 138 | name = "function.prepare_staging_folder_detail", |
127 | 139 | params = {"stagingFolder.getName()", "this.deployModel.getAppName()"}, |
|
0 commit comments