From b4d8d8b1f734febdf8c33579938b5a222112da88 Mon Sep 17 00:00:00 2001 From: Hanxiao Liu Date: Fri, 20 Mar 2020 11:31:18 +0800 Subject: [PATCH] Fix SDK dependency issue (#4161) * Upgrade java SDK to 1.30.0 * Add preview to explorer node label --- .../ui/config/messages.properties | 2 +- .../ui/classpath/messages.properties | 2 +- .../azuretools/core/utils/messages.properties | 2 +- .../microsoft/intellij/util/PluginHelper.java | 2 +- .../docker/ops/utils/AzureDockerUtils.java | 6 +++-- .../helpers/azure/sdk/AzureSDKManager.java | 22 +++++++++---------- .../azure/function/FunctionModule.java | 2 +- .../model/function/FunctionAppWrapper.java | 6 +++++ Utils/pom.xml | 4 ++-- 9 files changed, 27 insertions(+), 21 deletions(-) diff --git a/PluginsAndFeatures/AddLibrary/AppInsights/com.microsoft.applicationinsights.ui/src/main/java/com/microsoft/applicationinsights/ui/config/messages.properties b/PluginsAndFeatures/AddLibrary/AppInsights/com.microsoft.applicationinsights.ui/src/main/java/com/microsoft/applicationinsights/ui/config/messages.properties index f40c69aa47..1355766648 100644 --- a/PluginsAndFeatures/AddLibrary/AppInsights/com.microsoft.applicationinsights.ui/src/main/java/com/microsoft/applicationinsights/ui/config/messages.properties +++ b/PluginsAndFeatures/AddLibrary/AppInsights/com.microsoft.applicationinsights.ui/src/main/java/com/microsoft/applicationinsights/ui/config/messages.properties @@ -14,7 +14,7 @@ depLocation=dependencies/ excp=Exception in getClasspathEntries azureSDKcontainerID=com.microsoft.azuretools.SDK_CONTAINER sdkID=com.microsoft.azuretools.sdk -sdkJar=dependencies/azure-1.26.0.jar +sdkJar=dependencies/azure-1.30.0.jar jstDep=org.eclipse.jst.component.dependency aiCheckBoxTxt=Enable telemetry with Application Insights webxmlPath=WebContent/WEB-INF/web.xml diff --git a/PluginsAndFeatures/AddLibrary/AzureLibraries/com.microsoft.azuretools.wasdkjava.ui/src/main/java/com/microsoft/azuretools/wasdkjava/ui/classpath/messages.properties b/PluginsAndFeatures/AddLibrary/AzureLibraries/com.microsoft.azuretools.wasdkjava.ui/src/main/java/com/microsoft/azuretools/wasdkjava/ui/classpath/messages.properties index 514786bbc9..70e8492833 100644 --- a/PluginsAndFeatures/AddLibrary/AzureLibraries/com.microsoft.azuretools.wasdkjava.ui/src/main/java/com/microsoft/azuretools/wasdkjava/ui/classpath/messages.properties +++ b/PluginsAndFeatures/AddLibrary/AzureLibraries/com.microsoft.azuretools.wasdkjava.ui/src/main/java/com/microsoft/azuretools/wasdkjava/ui/classpath/messages.properties @@ -7,7 +7,7 @@ lblVersion=Version : libNotAvail=Library is not available. notFound=Not found sdkID=com.microsoft.azuretools.sdk -sdkJar=dependencies/azure-1.26.0.jar +sdkJar=dependencies/azure-1.30.0.jar title=Microsoft Azure Libraries for Java verNotAvail=The selected version is not available. version1=Microsoft Azure Libraries for Java, version %s.%s.%s diff --git a/PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/src/com/microsoft/azuretools/core/utils/messages.properties b/PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/src/com/microsoft/azuretools/core/utils/messages.properties index 3da665d8fe..7d5f9bee0a 100644 --- a/PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/src/com/microsoft/azuretools/core/utils/messages.properties +++ b/PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/src/com/microsoft/azuretools/core/utils/messages.properties @@ -56,7 +56,7 @@ err=Error prefFileName=WAEclipsePlugin bundleName=org.eclipse.core.runtime sdkLibBundleName=com.microsoftopentechnologies.windowsazure.tools.sdk -sdkLibBaseJar=dependencies/azure-1.26.0.jar +sdkLibBaseJar=dependencies/azure-1.30.0.jar SDKLocErrMsg=Error occurred while retrieving path of Azure libraries resCLExWkspRfrsh=Exception while refresh of workspace. cmhLblStrgAcc=Storage Accounts diff --git a/PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/util/PluginHelper.java b/PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/util/PluginHelper.java index 9f960d9d22..e9303f5948 100644 --- a/PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/util/PluginHelper.java +++ b/PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/util/PluginHelper.java @@ -28,7 +28,7 @@ public class PluginHelper { - private static final String AZURE_ARTIFACT = "azure-1.26.0.jar"; + private static final String AZURE_ARTIFACT = "azure-1.30.0.jar"; /** * @return resource filename in plugin's directory diff --git a/Utils/azure-explorer-common/src/com/microsoft/azure/docker/ops/utils/AzureDockerUtils.java b/Utils/azure-explorer-common/src/com/microsoft/azure/docker/ops/utils/AzureDockerUtils.java index cfba96d54f..a6c2a234ca 100644 --- a/Utils/azure-explorer-common/src/com/microsoft/azure/docker/ops/utils/AzureDockerUtils.java +++ b/Utils/azure-explorer-common/src/com/microsoft/azure/docker/ops/utils/AzureDockerUtils.java @@ -32,7 +32,9 @@ import com.microsoft.azure.management.resources.Location; import com.microsoft.azure.management.resources.ResourceGroup; import com.microsoft.azure.management.resources.Subscription; +import com.microsoft.azure.management.storage.SkuName; import com.microsoft.azure.management.storage.StorageAccount; +import com.microsoft.azure.management.storage.StorageAccountSkuType; import com.microsoft.azuretools.authmanage.SubscriptionManager; import com.microsoft.azuretools.authmanage.models.SubscriptionDetail; import com.microsoft.azuretools.sdkmanage.AzureManager; @@ -233,7 +235,7 @@ public static List getAvailableStorageAccounts(Azure azureClient, String if (azureClient != null) { for (StorageAccount storageAccount : azureClient.storageAccounts().list()) { if (vmImageSizeType != null) { - if (storageAccount.sku().name().name().toLowerCase().equals(vmImageSizeType.toLowerCase())) { + if (storageAccount.skuType().name() != null && storageAccount.skuType().name().equals(SkuName.fromString(vmImageSizeType.toLowerCase()))) { result.add(storageAccount.name()); } } else { @@ -255,7 +257,7 @@ public static List getStorageAccounts(Azure azureClie dockerStorageAccount.region = storageAccount.regionName(); dockerStorageAccount.resourceGroup = storageAccount.resourceGroupName(); dockerStorageAccount.sid = azureClient.subscriptionId(); - dockerStorageAccount.skuType = storageAccount.sku().name().name(); + dockerStorageAccount.skuType = storageAccount.skuType().name().toString(); result.add(dockerStorageAccount); } } diff --git a/Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/helpers/azure/sdk/AzureSDKManager.java b/Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/helpers/azure/sdk/AzureSDKManager.java index cbad15e671..dabde19f17 100644 --- a/Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/helpers/azure/sdk/AzureSDKManager.java +++ b/Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/helpers/azure/sdk/AzureSDKManager.java @@ -63,18 +63,16 @@ public static StorageAccount createStorageAccount(String subscriptionId, String } else { newStorageAccountWithGroup = newStorageAccountBlank.withExistingResourceGroup(resourceGroup); } - switch (kind) { - case STORAGE: - newStorageAccountWithGroup = newStorageAccountWithGroup.withGeneralPurposeAccountKind(); - break; - case STORAGE_V2: - newStorageAccountWithGroup = newStorageAccountWithGroup.withGeneralPurposeAccountKindV2(); - break; - case BLOB_STORAGE: - newStorageAccountWithGroup = newStorageAccountWithGroup.withBlobStorageAccountKind().withAccessTier(accessTier); - break; - default: - throw new Exception("Unknown Storage Account Kind:" + kind.toString()); + + if (Kind.STORAGE.equals(kind)) { + newStorageAccountWithGroup = newStorageAccountWithGroup.withGeneralPurposeAccountKind(); + } else if (Kind.STORAGE_V2.equals(kind)) { + newStorageAccountWithGroup = newStorageAccountWithGroup.withGeneralPurposeAccountKindV2(); + } else if (Kind.BLOB_STORAGE.equals(kind)) { + newStorageAccountWithGroup = newStorageAccountWithGroup.withBlobStorageAccountKind().withAccessTier(accessTier); + } else { + throw new Exception("Unknown Storage Account Kind:" + kind.toString()); + } if (enableEncription) { diff --git a/Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/serviceexplorer/azure/function/FunctionModule.java b/Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/serviceexplorer/azure/function/FunctionModule.java index e510496430..efb444ff29 100644 --- a/Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/serviceexplorer/azure/function/FunctionModule.java +++ b/Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/serviceexplorer/azure/function/FunctionModule.java @@ -39,7 +39,7 @@ public class FunctionModule extends AzureRefreshableNode implements FunctionModuleView { private static final String FUNCTION_SERVICE_MODULE_ID = FunctionModule.class.getName(); private static final String ICON_PATH = "azure-functions-small.png"; - private static final String BASE_MODULE_NAME = "Function App"; + private static final String BASE_MODULE_NAME = "Function App(Preview)"; private static final String FUNCTION_MODULE = "FunctionModule"; private static final String FAILED_TO_DELETE_FUNCTION_APP = "Failed to delete Function App %s"; private static final String ERROR_DELETING_FUNCTION_APP = "Azure Services Explorer - Error Deleting Function App"; diff --git a/Utils/azuretools-core/src/com/microsoft/azuretools/core/mvp/model/function/FunctionAppWrapper.java b/Utils/azuretools-core/src/com/microsoft/azuretools/core/mvp/model/function/FunctionAppWrapper.java index ff3c7bb9e1..2f72b3db14 100644 --- a/Utils/azuretools-core/src/com/microsoft/azuretools/core/mvp/model/function/FunctionAppWrapper.java +++ b/Utils/azuretools-core/src/com/microsoft/azuretools/core/mvp/model/function/FunctionAppWrapper.java @@ -26,6 +26,7 @@ import com.microsoft.azure.management.appservice.FunctionApp; import com.microsoft.azure.management.appservice.FunctionDeploymentSlots; import com.microsoft.azure.management.appservice.NameValuePair; +import com.microsoft.azure.management.appservice.SupportedTlsVersions; import com.microsoft.azure.management.appservice.WebAppBase; import com.microsoft.azure.management.appservice.implementation.SiteInner; import com.microsoft.azure.management.storage.StorageAccount; @@ -117,6 +118,11 @@ public FunctionApp.Update update() { return getFunctionApp().update(); } + @Override + public SupportedTlsVersions minTlsVersion() { + return getFunctionApp().minTlsVersion(); + } + @Override protected WebAppBase getWebAppBase() { return getFunctionApp(); diff --git a/Utils/pom.xml b/Utils/pom.xml index 9f82928757..962898cb44 100644 --- a/Utils/pom.xml +++ b/Utils/pom.xml @@ -321,7 +321,7 @@ com.microsoft.azure azure - 1.26.0 + 1.30.0 javax.xml.bind @@ -362,7 +362,7 @@ com.microsoft.azure azure-mgmt-storage - 1.26.0 + 1.30.0 com.microsoft.azure