Skip to content

Commit dd54bc3

Browse files
Merge remote-tracking branch 'origin/endgame-202401' into develop
2 parents c5d13b9 + 868a561 commit dd54bc3

File tree

12 files changed

+96
-27
lines changed

12 files changed

+96
-27
lines changed

.azure-pipelines/sign-for-dev-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ extends:
104104
inputs:
105105
targetType: inline
106106
script: |
107-
(cd PluginsAndFeatures/azure-toolkit-for-intellij && ./gradlew clean buildPlugin -s -Papplicationinsights.key=$(INTELLIJ_KEY) -PneedPatchVersion=$(IS_FOR_DEV_RELEASE) -Psources=false -Porg.gradle.configureondemand=false -Porg.gradle.daemon=false -Porg.gradle.unsafe.configuration-cache=false -Porg.gradle.caching=false)
107+
(cd PluginsAndFeatures/azure-toolkit-for-intellij && ./gradlew clean buildPlugin -s -Papplicationinsights.key=$(INTELLIJ_KEY) -PneedPatchVersion=true -Psources=false -Porg.gradle.configureondemand=false -Porg.gradle.daemon=false -Porg.gradle.unsafe.configuration-cache=false -Porg.gradle.caching=false)
108108
109109
mkdir -p ./artifacts/intellij/
110110
cp ./PluginsAndFeatures/azure-toolkit-for-intellij/build/distributions/*.zip ./artifacts/intellij/azure-toolkit-for-intellij.zip

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in this file.
44

55
- [Change Log](#change-log)
6+
- [3.85.0](#3850)
67
- [3.84.0](#3840)
78
- [3.83.0](#3830)
89
- [3.82.0](#3820)
@@ -106,6 +107,24 @@ All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in t
106107
- [3.0.7](#307)
107108
- [3.0.6](#306)
108109

110+
## 3.85.0
111+
### Added
112+
- Support for containerized FunctionApps (based on Azure Container Apps)
113+
- Support for creating docker WebApp/FunctionApp
114+
- Support for Managing Azure Container Registries (ACR) with bundled Docker plugin (2023.3) in integrated `Services` view.
115+
- Warn user when creating/deploying WebApps/FunctionApps of (to-be-) deprected runtime.
116+
117+
### Updated
118+
- Update icon of WebApp/FunctionApp to indicate its runtime.
119+
120+
### Fixed
121+
- [#8118](https://github.com/microsoft/azure-tools-for-java/issues/8118): NPE at EnvVarLineMarkerProvider.
122+
- [#8113](https://github.com/microsoft/azure-tools-for-java/issues/8113): java.nio.file.NoSuchFileException at AzureModule.getDefaultProfileName.
123+
- [#8109](https://github.com/microsoft/azure-tools-for-java/issues/8109): java.lang.ClassCastException at StoragePathPrefixCompletionProvider.addCompletions.
124+
- [#8093](https://github.com/microsoft/azure-tools-for-java/issues/8093): Speed Search not working correctly.
125+
- [#8081](https://github.com/microsoft/azure-tools-for-java/issues/8081): java.lang.AssertionError at AzureCognitiveServices.accounts.
126+
- [#8063](https://github.com/microsoft/azure-tools-for-java/issues/8063): java.lang.ArrayIndexOutOfBoundsException at TreeUtils.selectResourceNode.
127+
109128
## 3.84.0
110129
### Added
111130
- Browse Azure sample projects and create new project from them.

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/appservice/AppServiceInfoAdvancedPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
@Getter
5353
public class AppServiceInfoAdvancedPanel<T extends AppServiceConfig> extends JPanel implements AzureFormPanel<T> {
5454
public static final ContainerAppDraft.ImageConfig QUICK_START_IMAGE =
55-
new ContainerAppDraft.ImageConfig("mcr.microsoft.com/azuredocs/containerapps-helloworld:latest");
55+
new ContainerAppDraft.ImageConfig("mcr.microsoft.com/appsvc/staticsite:latest");
5656
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyMMddHHmmss");
5757
private static final String NOT_APPLICABLE = "N/A";
5858
private final Project project;

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/appservice/AppServiceInfoBasicPanel.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@
1515
import com.microsoft.azure.toolkit.lib.appservice.config.AppServiceConfig;
1616
import com.microsoft.azure.toolkit.lib.appservice.config.FunctionAppConfig;
1717
import com.microsoft.azure.toolkit.lib.appservice.config.RuntimeConfig;
18+
import com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem;
1819
import com.microsoft.azure.toolkit.lib.appservice.model.Runtime;
1920
import com.microsoft.azure.toolkit.lib.auth.Account;
2021
import com.microsoft.azure.toolkit.lib.auth.AzureAccount;
2122
import com.microsoft.azure.toolkit.lib.common.form.AzureFormInput;
2223
import com.microsoft.azure.toolkit.lib.common.model.Subscription;
24+
import lombok.Getter;
25+
import lombok.Setter;
2326
import lombok.SneakyThrows;
2427
import org.apache.commons.compress.utils.FileNameUtils;
2528
import org.apache.commons.lang3.ObjectUtils;
2629
import org.apache.commons.lang3.StringUtils;
2730

2831
import javax.swing.*;
29-
import java.text.SimpleDateFormat;
3032
import java.util.*;
3133
import java.util.function.Supplier;
3234

@@ -45,6 +47,9 @@ public class AppServiceInfoBasicPanel<T extends AppServiceConfig> extends JPanel
4547
private JLabel lblArtifact;
4648
private JLabel lblName;
4749
private JLabel lblPlatform;
50+
@Setter
51+
@Getter
52+
private String defaultImage;
4853

4954
public AppServiceInfoBasicPanel(final Project project, final Supplier<? extends T> defaultConfigSupplier) {
5055
super();
@@ -82,16 +87,16 @@ public T getValue() {
8287
.orElseGet(() -> account.getSelectedSubscriptions().stream().findFirst().orElse(null));
8388
final T result = this.config == null ? supplier.get() : this.config;
8489
result.appName(name);
85-
Optional.ofNullable(platform).map(RuntimeConfig::fromRuntime).ifPresent(result::runtime);
8690
Optional.ofNullable(subscription).map(Subscription::getId).ifPresent(result::subscriptionId);
87-
// todo: web app creation dialog should use run/deploy configuration, which should be parent of info panel
88-
// if (Objects.nonNull(artifact)) {
89-
// final AzureArtifactManager manager = AzureArtifactManager.getInstance(this.project);
90-
// final String path = this.selectorApplication.getValue().getFileForDeployment();
91-
// result.setApplication(Paths.get(path));
92-
// }
91+
Optional.ofNullable(platform).filter(r -> !r.isDocker()).map(RuntimeConfig::fromRuntime).ifPresent(result::runtime);
92+
if (Objects.nonNull(platform) && platform.isDocker()) {
93+
final RuntimeConfig runtime = Optional.ofNullable(result.runtime()).orElseGet(RuntimeConfig::new);
94+
runtime.os(OperatingSystem.DOCKER);
95+
runtime.image(StringUtils.firstNonBlank(runtime.image(), defaultImage));
96+
result.runtime(runtime);
97+
}
98+
result.appSettings(ObjectUtils.firstNonNull(this.config.appSettings(), new HashMap<>()));
9399
this.config = result;
94-
this.config.appSettings(ObjectUtils.firstNonNull(this.config.appSettings(), new HashMap<>()));
95100
return config;
96101
}
97102

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/function/FunctionAppCreationDialog.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
import com.microsoft.azure.toolkit.intellij.common.AzureFormPanel;
1111
import com.microsoft.azure.toolkit.intellij.common.ConfigDialog;
1212
import com.microsoft.azure.toolkit.intellij.legacy.appservice.AppServiceInfoBasicPanel;
13+
import com.microsoft.azure.toolkit.lib.appservice.config.AppServiceConfig;
14+
import com.microsoft.azure.toolkit.lib.appservice.config.AppServicePlanConfig;
1315
import com.microsoft.azure.toolkit.lib.appservice.config.FunctionAppConfig;
16+
import com.microsoft.azure.toolkit.lib.appservice.config.RuntimeConfig;
1417
import com.microsoft.azure.toolkit.lib.appservice.model.FunctionAppRuntime;
18+
import com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem;
19+
import com.microsoft.azure.toolkit.lib.appservice.model.PricingTier;
20+
import com.microsoft.azure.toolkit.lib.appservice.plan.AppServicePlan;
1521
import com.microsoft.azure.toolkit.lib.auth.AzureAccount;
1622
import com.microsoft.azure.toolkit.lib.auth.IAccountActions;
1723
import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException;
@@ -25,6 +31,7 @@
2531
import java.util.Optional;
2632

2733
import static com.microsoft.azure.toolkit.intellij.common.AzureBundle.message;
34+
import static com.microsoft.azure.toolkit.intellij.legacy.function.FunctionAppInfoPanel.QUICK_START_IMAGE;
2835
import static com.microsoft.azure.toolkit.lib.Azure.az;
2936

3037
public class FunctionAppCreationDialog extends ConfigDialog<FunctionAppConfig> {
@@ -78,10 +85,27 @@ public FunctionAppConfig getValue() {
7885
insightConfig.setName(config.appName());
7986
}
8087
});
88+
89+
final OperatingSystem os = Optional.ofNullable(config)
90+
.map(FunctionAppConfig::runtime).map(RuntimeConfig::os).orElse(null);
91+
final PricingTier pricingTier = Optional.ofNullable(config)
92+
.map(FunctionAppConfig::getPricingTier).orElse(null);
93+
final Boolean isConsumption = Optional.ofNullable(pricingTier)
94+
.map(tier -> tier.isConsumption() || tier.isFlexConsumption()).orElse(false);
95+
// set draft plan pricing tier to premium if runtime is docker
96+
if (os == OperatingSystem.DOCKER && isConsumption) {
97+
Optional.of(config)
98+
.map(AppServiceConfig::getServicePlanConfig)
99+
.map(AppServicePlanConfig::getAppServicePlan)
100+
.filter(AppServicePlan::isDraftForCreating).ifPresent(ignore -> {
101+
config.pricingTier(PricingTier.PREMIUM_P1V2);
102+
});
103+
}
81104
return config;
82105
}
83106
};
84107
basicPanel.getSelectorRuntime().setPlatformList(FunctionAppRuntime.getMajorRuntimes());
108+
basicPanel.setDefaultImage(QUICK_START_IMAGE.getFullImageName());
85109
advancePanel = new FunctionAppAdvancedConfigPanel(project);
86110
}
87111
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/function/FunctionAppInfoPanel.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ public FunctionAppConfig getValue() {
115115
if (isDocker) {
116116
final ContainerAppDraft.ImageConfig image = chkUseQuickStart.isSelected() ? QUICK_START_IMAGE : pnlContainer.getValue();
117117
Optional.ofNullable(image).map(DockerUtils::convertImageConfigToRuntimeConfig).ifPresent(config::runtime);
118-
// workaround to fix worker runtime issue of default image, as it was a dot net one
119-
if (chkUseQuickStart.isSelected()) {
120-
final Map<String, String> appSettings = new HashMap<>(config.appSettings());
121-
appSettings.put("FUNCTIONS_WORKER_RUNTIME", "dotnet-isolated");
122-
config.appSettings(appSettings);
123-
}
124118
}
125119
return this.config;
126120
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/function/runner/deploy/FunctionDeploymentState.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public class FunctionDeploymentState extends AzureRunProfileState<FunctionAppBas
6262
private static final String NO_TRIGGERS_FOUNDED = "No triggers found in deployed function app";
6363

6464
private final FunctionDeployConfiguration functionDeployConfiguration;
65-
private final FunctionDeployModel deployModel;
6665
private File stagingFolder;
6766

6867
/**
@@ -71,7 +70,6 @@ public class FunctionDeploymentState extends AzureRunProfileState<FunctionAppBas
7170
public FunctionDeploymentState(Project project, FunctionDeployConfiguration functionDeployConfiguration) {
7271
super(project);
7372
this.functionDeployConfiguration = functionDeployConfiguration;
74-
this.deployModel = functionDeployConfiguration.getModel();
7573
}
7674

7775
@Nullable
@@ -177,6 +175,6 @@ protected void onFail(@NotNull Throwable error, @NotNull RunProcessHandler proce
177175

178176
@Override
179177
protected Map<String, String> getTelemetryMap() {
180-
return deployModel.getTelemetryProperties();
178+
return OperationContext.action().getTelemetryProperties();
181179
}
182180
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/webapp/WebAppCreationDialog.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.microsoft.azure.toolkit.intellij.appservice.AppServiceIntelliJActionsContributor;
1010
import com.microsoft.azure.toolkit.intellij.common.AzureFormPanel;
1111
import com.microsoft.azure.toolkit.intellij.common.ConfigDialog;
12+
import com.microsoft.azure.toolkit.intellij.legacy.appservice.AppServiceInfoAdvancedPanel;
1213
import com.microsoft.azure.toolkit.intellij.legacy.appservice.AppServiceInfoBasicPanel;
1314
import com.microsoft.azure.toolkit.lib.appservice.config.AppServiceConfig;
1415
import com.microsoft.azure.toolkit.lib.appservice.model.PricingTier;
@@ -74,5 +75,6 @@ private void createUIComponents() {
7475
}
7576
basicForm = new AppServiceInfoBasicPanel<>(project, () -> AppServiceIntelliJActionsContributor.getDefaultWebAppConfig(null));
7677
basicForm.setDeploymentVisible(false);
78+
basicForm.setDefaultImage(AppServiceInfoAdvancedPanel.QUICK_START_IMAGE.getFullImageName());
7779
}
7880
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/webapp/runner/webappconfig/WebAppRunState.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,8 @@ protected void onSuccess(WebAppBase<?, ?, ?> result, @NotNull RunProcessHandler
174174

175175
@Override
176176
protected Map<String, String> getTelemetryMap() {
177-
final Map<String, String> properties = new HashMap<>();
177+
final Map<String, String> properties = new HashMap<>(OperationContext.action().getTelemetryProperties());
178178
properties.put("artifactType", webAppConfiguration.getAzureArtifactType() == null ? null : webAppConfiguration.getAzureArtifactType().name());
179-
properties.putAll(webAppSettingModel.getTelemetryProperties(Collections.EMPTY_MAP));
180179
return properties;
181180
}
182181

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib-java/src/main/resources/whatsnew.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
<!-- Version: 3.83.0 -->
22
# What's new in Azure Toolkit for IntelliJ
3+
## 3.85.0
4+
### Added
5+
- Support for containerized FunctionApps (based on Azure Container Apps)
6+
- Support for creating docker WebApp/FunctionApp
7+
- Support for Managing Azure Container Registries (ACR) with bundled Docker plugin (2023.3) in integrated `Services` view.
8+
- Warn user when creating/deploying WebApps/FunctionApps of (to-be-) deprected runtime.
9+
10+
### Updated
11+
- Update icon of WebApp/FunctionApp to indicate its runtime.
12+
13+
### Fixed
14+
- [#8118](https://github.com/microsoft/azure-tools-for-java/issues/8118): NPE at EnvVarLineMarkerProvider.
15+
- [#8113](https://github.com/microsoft/azure-tools-for-java/issues/8113): java.nio.file.NoSuchFileException at AzureModule.getDefaultProfileName.
16+
- [#8109](https://github.com/microsoft/azure-tools-for-java/issues/8109): java.lang.ClassCastException at StoragePathPrefixCompletionProvider.addCompletions.
17+
- [#8093](https://github.com/microsoft/azure-tools-for-java/issues/8093): Speed Search not working correctly.
18+
- [#8081](https://github.com/microsoft/azure-tools-for-java/issues/8081): java.lang.AssertionError at AzureCognitiveServices.accounts.
19+
- [#8063](https://github.com/microsoft/azure-tools-for-java/issues/8063): java.lang.ArrayIndexOutOfBoundsException at TreeUtils.selectResourceNode.
320

421
## 3.84.0
522
### Added

0 commit comments

Comments
 (0)