, P extends AbstractAzResource, R> extends
12 | AzResourceModule {
13 | }
14 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/config/DeploymentSlotConfig.java:
--------------------------------------------------------------------------------
1 | package com.microsoft.azure.toolkit.lib.appservice.config;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 | import lombok.experimental.Accessors;
8 |
9 | @Data
10 | @Builder
11 | @NoArgsConstructor
12 | @AllArgsConstructor
13 | public class DeploymentSlotConfig {
14 | private String name;
15 | private String configurationSource;
16 | }
17 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/deploy/ZIPFunctionDeployHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.appservice.deploy;
6 |
7 | import com.azure.resourcemanager.appservice.models.WebAppBase;
8 | import com.microsoft.azure.toolkit.lib.common.messager.AzureMessager;
9 |
10 | import javax.annotation.Nonnull;
11 | import java.io.File;
12 |
13 | public class ZIPFunctionDeployHandler implements IFunctionDeployHandler {
14 | @Override
15 | public void deploy(@Nonnull File file, @Nonnull WebAppBase functionApp) {
16 | AzureMessager.getMessager().info(String.format(DEPLOY_START, functionApp.name()));
17 | functionApp.zipDeploy(file);
18 | AzureMessager.getMessager().info(String.format(DEPLOY_FINISH, functionApp.defaultHostname()));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/file/IFileClient.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.file;
7 |
8 | import com.microsoft.azure.toolkit.lib.appservice.model.AppServiceFile;
9 | import reactor.core.publisher.Flux;
10 |
11 | import java.nio.ByteBuffer;
12 | import java.util.List;
13 |
14 | public interface IFileClient {
15 | Flux getFileContent(final String path);
16 |
17 | List extends AppServiceFile> getFilesInDirectory(String dir);
18 |
19 | AppServiceFile getFileByPath(String path);
20 |
21 | void uploadFileToPath(String content, String path);
22 |
23 | void createDirectory(String path);
24 |
25 | void deleteFile(String path);
26 | }
27 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/file/IProcessClient.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.file;
7 |
8 | import com.microsoft.azure.toolkit.lib.appservice.model.CommandOutput;
9 | import com.microsoft.azure.toolkit.lib.appservice.model.ProcessInfo;
10 | import com.microsoft.azure.toolkit.lib.appservice.model.TunnelStatus;
11 |
12 | import java.util.List;
13 |
14 | public interface IProcessClient {
15 | List listProcess();
16 |
17 | CommandOutput execute(final String command, final String dir);
18 |
19 | TunnelStatus getAppServiceTunnelStatus();
20 | }
21 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/function/core/AzureFunctionsAnnotationConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.appservice.function.core;
6 |
7 | public class AzureFunctionsAnnotationConstants {
8 | // com.microsoft.azure.functions.annotation
9 | public static final String FUNCTION_NAME = "com.microsoft.azure.functions.annotation.FunctionName";
10 | public static final String STORAGE_ACCOUNT = "com.microsoft.azure.functions.annotation.StorageAccount";
11 | public static final String CUSTOM_BINDING = "com.microsoft.azure.functions.annotation.CustomBinding";
12 | public static final String FIXED_DELAY_RETRY = "com.microsoft.azure.functions.annotation.FixedDelayRetry";
13 | public static final String EXPONENTIAL_BACKOFF_RETRY = "com.microsoft.azure.functions.annotation.ExponentialBackoffRetry";
14 |
15 | // AuthorizationLevel
16 | public static final String ANONYMOUS = "ANONYMOUS";
17 | public static final String FUNCTION = "FUNCTION";
18 | public static final String ADMIN = "ADMIN";
19 | }
20 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/function/core/ExtendedCustomBinding.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.appservice.function.core;
6 |
7 | import com.microsoft.azure.toolkit.lib.legacy.function.bindings.Binding;
8 | import com.microsoft.azure.toolkit.lib.legacy.function.bindings.BindingEnum;
9 | import lombok.Getter;
10 |
11 | public class ExtendedCustomBinding extends Binding {
12 | @Getter
13 | private final String name;
14 |
15 | public ExtendedCustomBinding(String name, String direction, String type) {
16 | super(BindingEnum.CustomBinding);
17 | this.name = name;
18 | this.direction = BindingEnum.Direction.fromString(direction);
19 | this.type = type;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/function/core/FunctionAnnotationClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.appservice.function.core;
6 |
7 | import lombok.Getter;
8 | import lombok.Setter;
9 |
10 | import java.util.List;
11 |
12 | public class FunctionAnnotationClass implements IAnnotatable {
13 | @Setter
14 | @Getter
15 | private String fullName;
16 |
17 | @Setter
18 | @Getter
19 | private String name;
20 |
21 | @Setter
22 | @Getter
23 | private List annotations;
24 |
25 | @Override
26 | public String toString() {
27 | return fullName;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/function/core/FunctionMethod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.appservice.function.core;
6 |
7 | import lombok.Getter;
8 | import lombok.Setter;
9 |
10 | import java.util.List;
11 |
12 | public class FunctionMethod implements IAnnotatable {
13 | @Setter
14 | @Getter
15 | private String declaringTypeName;
16 |
17 | @Setter
18 | @Getter
19 | private String name;
20 |
21 | @Setter
22 | @Getter
23 | private String returnTypeName;
24 |
25 | @Setter
26 | @Getter
27 | private List annotations;
28 |
29 | @Setter
30 | @Getter
31 | private List parameterAnnotations;
32 |
33 | @Override
34 | public String toString() {
35 | return declaringTypeName + "." + name;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/function/core/FunctionProject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.appservice.function.core;
6 |
7 | import lombok.Getter;
8 | import lombok.Setter;
9 |
10 | import java.io.File;
11 | import java.util.List;
12 |
13 | @Setter
14 | @Getter
15 | public abstract class FunctionProject {
16 | private String name;
17 | private File stagingFolder;
18 | private File baseDirectory;
19 | private File artifactFile;
20 | private List dependencies;
21 |
22 | private File classesOutputDirectory;
23 | private File resourceOutputDirectory;
24 |
25 | private File hostJsonFile;
26 | private File localSettingsJsonFile;
27 |
28 | public abstract List findAnnotatedMethods();
29 |
30 | public abstract void installExtension(String funcPath);
31 | }
32 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/function/core/IAnnotatable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.appservice.function.core;
6 |
7 | import org.apache.commons.lang3.StringUtils;
8 |
9 | import java.lang.annotation.Annotation;
10 | import java.util.List;
11 |
12 | public interface IAnnotatable {
13 | List getAnnotations();
14 |
15 | default FunctionAnnotation getAnnotation(Class extends Annotation> clz) {
16 | return getAnnotations().stream().filter(annotation -> annotation.isAnnotationType(clz)).findFirst().orElse(null);
17 | }
18 |
19 | default FunctionAnnotation getAnnotation(String annotationName) {
20 | return getAnnotations().stream()
21 | .filter(annotation -> StringUtils.equals(annotation.getAnnotationClassName(), annotationName)).findFirst().orElse(null);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/ApplicationInsightsConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.appservice.model;
6 |
7 | import com.microsoft.azure.toolkit.lib.monitor.LogAnalyticsWorkspaceConfig;
8 | import lombok.AllArgsConstructor;
9 | import lombok.EqualsAndHashCode;
10 | import lombok.Getter;
11 | import lombok.NoArgsConstructor;
12 | import lombok.Setter;
13 | import lombok.experimental.SuperBuilder;
14 |
15 | @Getter
16 | @Setter
17 | @SuperBuilder
18 | @NoArgsConstructor
19 | @AllArgsConstructor
20 | public class ApplicationInsightsConfig {
21 | @EqualsAndHashCode.Include
22 | private String name;
23 | @EqualsAndHashCode.Include
24 | private String instrumentationKey;
25 | private Boolean createNewInstance;
26 | private Boolean disableAppInsights;
27 | private LogAnalyticsWorkspaceConfig workspaceConfig;
28 | }
29 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/CommandOutput.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import lombok.Data;
9 |
10 | @Data
11 | public class CommandOutput {
12 | private String Output;
13 | private String Error;
14 | private int ExitCode;
15 | }
16 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/CsmDeploymentStatus.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import lombok.Builder;
9 | import lombok.Data;
10 | import lombok.EqualsAndHashCode;
11 |
12 | import java.util.List;
13 | import java.util.stream.Stream;
14 |
15 | @Data
16 | @Builder
17 | @EqualsAndHashCode
18 | public class CsmDeploymentStatus {
19 | private String deploymentId;
20 | private DeploymentBuildStatus status;
21 | private Integer numberOfInstancesInProgress;
22 | private Integer numberOfInstancesSuccessful;
23 | private Integer numberOfInstancesFailed;
24 | private List failedInstancesLogs;
25 | private List errors;
26 |
27 | public int getTotalInstanceCount() {
28 | return Stream.of(numberOfInstancesInProgress, numberOfInstancesFailed, numberOfInstancesSuccessful)
29 | .filter(i -> i != null)
30 | .mapToInt(Integer::intValue).sum();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/DeployOptions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.appservice.model;
6 |
7 | import lombok.Builder;
8 | import lombok.Data;
9 | import lombok.EqualsAndHashCode;
10 |
11 | @Data
12 | @Builder
13 | @EqualsAndHashCode
14 | public class DeployOptions {
15 | private String path;
16 | private Boolean restartSite;
17 | private Boolean cleanDeployment;
18 | private Boolean trackDeployment;
19 | }
20 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/DiagnosticConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import lombok.AllArgsConstructor;
9 | import lombok.Builder;
10 | import lombok.EqualsAndHashCode;
11 | import lombok.Getter;
12 | import lombok.NoArgsConstructor;
13 | import lombok.Setter;
14 |
15 | @Getter
16 | @Setter
17 | @NoArgsConstructor
18 | @AllArgsConstructor
19 | @EqualsAndHashCode
20 | @Builder
21 | public class DiagnosticConfig {
22 | @Builder.Default
23 | boolean enableWebServerLogging = true;
24 | @Builder.Default
25 | Integer webServerLogQuota = 35;
26 | @Builder.Default
27 | Integer webServerRetentionPeriod = 0;
28 | @Builder.Default
29 | boolean enableDetailedErrorMessage = false;
30 | @Builder.Default
31 | boolean enableFailedRequestTracing = false;
32 | // application log
33 | @Builder.Default
34 | boolean enableApplicationLog = true;
35 | @Builder.Default
36 | LogLevel applicationLogLevel = LogLevel.ERROR;
37 | }
38 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/DockerConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.appservice.model;
6 |
7 | import lombok.EqualsAndHashCode;
8 | import lombok.Getter;
9 | import lombok.experimental.SuperBuilder;
10 | import org.apache.commons.lang3.StringUtils;
11 |
12 | @Getter
13 | @SuperBuilder
14 | @EqualsAndHashCode
15 | public class DockerConfiguration {
16 | private String image;
17 | private String registryUrl;
18 | private String userName;
19 | private String password;
20 | private String startUpCommand;
21 |
22 | public boolean isPublic() {
23 | return StringUtils.isAllEmpty(userName, password);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/ErrorEntity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import lombok.Builder;
9 | import lombok.Data;
10 | import lombok.EqualsAndHashCode;
11 |
12 | import java.util.List;
13 |
14 | @Data
15 | @Builder
16 | @EqualsAndHashCode
17 | public class ErrorEntity {
18 | private String extendedCode;
19 | private String messageTemplate;
20 | private List parameters;
21 | private List innerErrors;
22 | private List details;
23 | private String target;
24 | private String code;
25 | private String message;
26 | }
27 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/FunctionAppDockerRuntime.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import lombok.AccessLevel;
9 | import lombok.Getter;
10 | import lombok.NoArgsConstructor;
11 |
12 | import javax.annotation.Nonnull;
13 |
14 | @NoArgsConstructor(access = AccessLevel.PRIVATE)
15 | public class FunctionAppDockerRuntime implements FunctionAppRuntime {
16 | public static FunctionAppDockerRuntime INSTANCE = new FunctionAppDockerRuntime();
17 | @Getter
18 | private final OperatingSystem operatingSystem = OperatingSystem.DOCKER;
19 |
20 | @Nonnull
21 | @Override
22 | public String getJavaVersionNumber() {
23 | return "null";
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/FunctionDeployType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException;
9 | import org.apache.commons.lang3.StringUtils;
10 |
11 | import java.util.Arrays;
12 |
13 | public enum FunctionDeployType {
14 | FTP,
15 | ZIP,
16 | MSDEPLOY,
17 | RUN_FROM_ZIP,
18 | RUN_FROM_BLOB,
19 |
20 | FLEX;
21 |
22 | private static final String UNKNOWN_DEPLOYMENT_TYPE = "The value of is unknown.";
23 |
24 | public static FunctionDeployType fromString(final String input) {
25 | return Arrays.stream(FunctionDeployType.values())
26 | .filter(type -> StringUtils.equalsAnyIgnoreCase(type.name(), input))
27 | .findFirst().orElseThrow(() -> new AzureToolkitRuntimeException(UNKNOWN_DEPLOYMENT_TYPE));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/KuduDeploymentResult.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import lombok.Builder;
9 | import lombok.Data;
10 | import lombok.EqualsAndHashCode;
11 |
12 | @Data
13 | @Builder
14 | @EqualsAndHashCode
15 | public class KuduDeploymentResult {
16 | private final String deploymentId;
17 | }
18 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/OperatingSystem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import com.fasterxml.jackson.annotation.JsonAutoDetect;
9 | import lombok.AllArgsConstructor;
10 | import lombok.Getter;
11 | import lombok.NoArgsConstructor;
12 | import org.apache.commons.lang3.StringUtils;
13 |
14 | import java.util.Arrays;
15 |
16 | @Getter
17 | @NoArgsConstructor
18 | @AllArgsConstructor
19 | @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
20 | public enum OperatingSystem {
21 | WINDOWS("windows"),
22 | LINUX("linux"),
23 | DOCKER("docker");
24 |
25 | private String value;
26 |
27 | public static OperatingSystem fromString(String value) {
28 | return Arrays.stream(values()).filter(operatingSystem -> StringUtils.equalsIgnoreCase(operatingSystem.value, value))
29 | .findFirst().orElse(null);
30 | }
31 |
32 | @Override
33 | public String toString() {
34 | return StringUtils.capitalize(value);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/ProcessInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import lombok.Data;
9 |
10 | @Data
11 | public class ProcessInfo {
12 | private int id;
13 | private String name;
14 | }
15 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/StorageAuthenticationMethod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import org.apache.commons.lang3.StringUtils;
9 |
10 | import javax.annotation.Nonnull;
11 | import javax.annotation.Nullable;
12 | import java.util.Arrays;
13 |
14 | public enum StorageAuthenticationMethod {
15 | SystemAssignedIdentity,
16 | UserAssignedIdentity,
17 | StorageAccountConnectionString;
18 |
19 | @Nullable
20 | public static StorageAuthenticationMethod fromString(@Nonnull final String value) {
21 | if (StringUtils.isBlank(value)) {
22 | return null;
23 | }
24 | return Arrays.stream(values())
25 | .filter(method -> StringUtils.equalsIgnoreCase(method.name(), value))
26 | .findFirst().orElse(null);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/TunnelStatus.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import lombok.Data;
9 |
10 | @Data
11 | public class TunnelStatus {
12 | private int port;
13 | private String state;
14 | private boolean canReachPort;
15 | private String msg;
16 | }
17 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/model/WebAppArtifact.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.appservice.model;
7 |
8 | import lombok.Getter;
9 | import lombok.experimental.SuperBuilder;
10 |
11 | import java.io.File;
12 |
13 | @Getter
14 | @SuperBuilder(toBuilder = true)
15 | public class WebAppArtifact {
16 | private File file;
17 | private String path;
18 | private DeployType deployType;
19 | }
20 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/appservice/DeploymentSlotSetting.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.appservice;
7 |
8 | import com.fasterxml.jackson.annotation.JsonAutoDetect;
9 |
10 | /**
11 | * Deployment Slot setting class.
12 | */
13 | @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
14 | public class DeploymentSlotSetting {
15 | protected String name;
16 | protected String configurationSource;
17 |
18 | public String getName() {
19 | return this.name;
20 | }
21 |
22 | public void setName(String name) {
23 | this.name = name;
24 | }
25 |
26 | public String getConfigurationSource() {
27 | return this.configurationSource;
28 | }
29 |
30 | public void setConfigurationSource(String configurationSource) {
31 | this.configurationSource = configurationSource;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/appservice/DockerImageType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.appservice;
7 |
8 | public enum DockerImageType {
9 | NONE,
10 | PUBLIC_DOCKER_HUB,
11 | PRIVATE_DOCKER_HUB,
12 | PRIVATE_REGISTRY,
13 | UNKNOWN
14 | }
15 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/docker/IDockerCredentialProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.docker;
7 |
8 | import com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException;
9 |
10 | public interface IDockerCredentialProvider {
11 | String getUsername() throws AzureExecutionException;
12 |
13 | String getPassword() throws AzureExecutionException;
14 |
15 | void validate() throws AzureExecutionException;
16 | }
17 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/Constants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function;
7 |
8 | public class Constants {
9 | public static final String APP_SETTING_WEBSITE_RUN_FROM_PACKAGE = "WEBSITE_RUN_FROM_PACKAGE";
10 | public static final String APP_SETTING_MACHINEKEY_DECRYPTION_KEY = "MACHINEKEY_DecryptionKey";
11 | public static final String APP_SETTING_WEBSITES_ENABLE_APP_SERVICE_STORAGE = "WEBSITES_ENABLE_APP_SERVICE_STORAGE";
12 | public static final String APP_SETTING_DISABLE_WEBSITES_APP_SERVICE_STORAGE = "false";
13 | public static final String APP_SETTING_FUNCTION_APP_EDIT_MODE = "FUNCTION_APP_EDIT_MODE";
14 | public static final String APP_SETTING_FUNCTION_APP_EDIT_MODE_READONLY = "readOnly";
15 | public static final String ZIP_EXT = ".zip";
16 | public static final String LOCAL_SETTINGS_FILE = "local.settings.json";
17 | public static final String INTERNAL_STORAGE_KEY = "AzureWebJobsStorage";
18 | }
19 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/configurations/FunctionExtensionVersion.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.configurations;
7 |
8 | public enum FunctionExtensionVersion {
9 |
10 | VERSION_2(2, "~2"),
11 | VERSION_3(3, "~3"),
12 | VERSION_4(4, "~4"),
13 | BETA(Integer.MAX_VALUE, "beta"), // beta refers to the latest version
14 | UNKNOWN(Integer.MIN_VALUE, "unknown");
15 |
16 | private int value;
17 | private String version;
18 |
19 | FunctionExtensionVersion(int value, String version) {
20 | this.version = version;
21 | this.value = value;
22 | }
23 |
24 | public int getValue() {
25 | return value;
26 | }
27 |
28 | public String getVersion() {
29 | return version;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/handlers/AnnotationHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.handlers;
7 |
8 | import com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException;
9 | import com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionConfiguration;
10 |
11 | import java.lang.reflect.Method;
12 | import java.net.URL;
13 | import java.util.List;
14 | import java.util.Map;
15 | import java.util.Set;
16 |
17 | public interface AnnotationHandler {
18 | Set findFunctions(final List urls);
19 |
20 | Map generateConfigurations(final Set methods) throws AzureExecutionException;
21 |
22 | FunctionConfiguration generateConfiguration(final Method method) throws AzureExecutionException;
23 | }
24 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/handlers/CommandHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.handlers;
7 |
8 | import com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException;
9 |
10 | import java.util.List;
11 |
12 | public interface CommandHandler {
13 |
14 | void runCommandWithReturnCodeCheck(final String command,
15 | final boolean showStdout,
16 | final String workingDirectory,
17 | final List validReturnCodes,
18 | final String errorMessage) throws AzureExecutionException;
19 |
20 | String runCommandAndGetOutput(final String command,
21 | final boolean showStdout,
22 | final String workingDirectory) throws AzureExecutionException;
23 | }
24 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/handlers/FunctionCoreToolsHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.handlers;
7 |
8 | import com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException;
9 |
10 | import java.io.File;
11 |
12 | public interface FunctionCoreToolsHandler {
13 | void installExtension(File stagingDirectory, File basedir) throws AzureExecutionException;
14 | }
15 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/template/BindingConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 | package com.microsoft.azure.toolkit.lib.legacy.function.template;
6 |
7 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
8 | import com.fasterxml.jackson.annotation.JsonInclude;
9 | import com.microsoft.azure.toolkit.lib.legacy.function.bindings.BindingEnum;
10 | import lombok.AllArgsConstructor;
11 | import lombok.Data;
12 | import lombok.NoArgsConstructor;
13 | import org.apache.commons.lang3.StringUtils;
14 |
15 | @Data
16 | @NoArgsConstructor
17 | @AllArgsConstructor
18 | @JsonInclude(JsonInclude.Include.NON_EMPTY)
19 | @JsonIgnoreProperties(ignoreUnknown = true)
20 | public class BindingConfiguration {
21 | private String type;
22 | private String direction;
23 |
24 | public boolean isTrigger() {
25 | return StringUtils.equalsIgnoreCase(this.getDirection(), BindingEnum.Direction.IN.name()) &&
26 | StringUtils.containsIgnoreCase(this.getType(), "trigger");
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/template/FunctionTemplates.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.template;
7 |
8 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
9 | import com.fasterxml.jackson.annotation.JsonInclude;
10 | import com.fasterxml.jackson.annotation.JsonProperty;
11 | import lombok.AllArgsConstructor;
12 | import lombok.Data;
13 | import lombok.NoArgsConstructor;
14 |
15 | import java.util.List;
16 |
17 | @Data
18 | @NoArgsConstructor
19 | @AllArgsConstructor
20 | @JsonInclude(JsonInclude.Include.NON_EMPTY)
21 | @JsonIgnoreProperties(ignoreUnknown = true)
22 | public class FunctionTemplates {
23 | @JsonProperty("$schema")
24 | private String schema;
25 | private String contentVersion;
26 | private List templates;
27 | }
28 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/template/TemplateMetadata.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.template;
7 |
8 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
9 | import com.fasterxml.jackson.annotation.JsonInclude;
10 | import lombok.AllArgsConstructor;
11 | import lombok.Data;
12 | import lombok.NoArgsConstructor;
13 |
14 | import java.util.List;
15 |
16 | @Data
17 | @NoArgsConstructor
18 | @AllArgsConstructor
19 | @JsonInclude(JsonInclude.Include.NON_EMPTY)
20 | @JsonIgnoreProperties(ignoreUnknown = true)
21 | public class TemplateMetadata {
22 | private String name;
23 | private String description;
24 | private String defaultFunctionName;
25 | private String language;
26 | private List userPrompt;
27 | }
28 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/template/ValidatorTemplate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.template;
7 |
8 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
9 | import com.fasterxml.jackson.annotation.JsonInclude;
10 | import lombok.AllArgsConstructor;
11 | import lombok.Data;
12 | import lombok.NoArgsConstructor;
13 |
14 | // This is the json template class correspond to (bindings.json).bindings.settings.validators
15 | @Data
16 | @NoArgsConstructor
17 | @AllArgsConstructor
18 | @JsonInclude(JsonInclude.Include.NON_EMPTY)
19 | @JsonIgnoreProperties(ignoreUnknown = true)
20 | public class ValidatorTemplate {
21 | private String expression;
22 | private String errorText;
23 | }
24 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/utils/CommandUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.utils;
7 |
8 | import org.apache.commons.lang3.SystemUtils;
9 |
10 | import java.util.Arrays;
11 | import java.util.List;
12 |
13 | public class CommandUtils {
14 |
15 | public static boolean isWindows() {
16 | return SystemUtils.IS_OS_WINDOWS;
17 | }
18 |
19 | public static List getDefaultValidReturnCodes() {
20 | return Arrays.asList(0L);
21 | }
22 |
23 | public static List getValidReturnCodes() {
24 | return isWindows() ?
25 | // Windows return code of CTRL-C is 3221225786
26 | Arrays.asList(0L, 3221225786L) :
27 | // Linux return code of CTRL-C is 130
28 | Arrays.asList(0L, 130L);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/legacy/function/utils/DateUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.utils;
7 |
8 | import java.time.LocalDateTime;
9 | import java.time.ZoneId;
10 | import java.util.Date;
11 |
12 | public class DateUtils {
13 |
14 | public static Date convertLocalDateTimeToDate(LocalDateTime localDateTime) {
15 | return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
16 | }
17 |
18 | public static LocalDateTime convertDateToLocalDateTime(Date date) {
19 | return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService:
--------------------------------------------------------------------------------
1 | com.microsoft.azure.toolkit.lib.appservice.AzureAppService
2 | com.microsoft.azure.toolkit.lib.appservice.function.AzureFunctions
3 | com.microsoft.azure.toolkit.lib.appservice.webapp.AzureWebApp
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/resources/schema/com/microsoft/azure/toolkit/appservice/AppServicePlan.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema#",
3 | "title": "App Service Plan - Update",
4 | "description": "Schema for AppServicePlanConfig when update existing service plan",
5 | "properties": {
6 | "subscriptionId": {
7 | "$ref": "classpath:///schema/common/UUID.json"
8 | },
9 | "resourceGroupName": {
10 | "$ref": "classpath:///schema/common/ResourceGroupName.json"
11 | },
12 | "name": {
13 | "$ref": "classpath:///schema/appservice/AppServicePlanName.json"
14 | },
15 | "os": {
16 | "$ref": "classpath:///schema/appservice/Runtime.json#/definitions/os"
17 | },
18 | "region": {
19 | "type": "object"
20 | },
21 | "pricingTier": {
22 | "type": "object"
23 | }
24 | },
25 | "required": [
26 | "subscriptionId",
27 | "name",
28 | "resourceGroupName"
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/resources/schema/com/microsoft/azure/toolkit/appservice/CreateAppServicePlan.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema#",
3 | "title": "App Service Plan - Update",
4 | "description": "Schema for AppServicePlanConfig when update existing service plan",
5 | "allOf": [
6 | {
7 | "$ref": "classpath:///schema/appservice/AppServicePlan.json"
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/test/java/com/microsoft/azure/toolkit/lib/legacy/function/handlers/CommandHandlerImplTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.handlers;
7 |
8 | import org.junit.Test;
9 |
10 | import java.util.Arrays;
11 |
12 | import static org.junit.Assert.assertEquals;
13 |
14 | public class CommandHandlerImplTest {
15 | @Test
16 | public void buildCommand() {
17 | assertEquals(3, CommandHandlerImpl.buildCommand("cmd").length);
18 | }
19 |
20 | @Test
21 | public void getStdoutRedirect() {
22 | assertEquals(ProcessBuilder.Redirect.INHERIT, CommandHandlerImpl.getStdoutRedirect(true));
23 | assertEquals(ProcessBuilder.Redirect.PIPE, CommandHandlerImpl.getStdoutRedirect(false));
24 | }
25 |
26 | @Test(expected = Exception.class)
27 | public void handleExitValue() throws Exception {
28 | final CommandHandlerImpl handler = new CommandHandlerImpl();
29 | handler.handleExitValue(1, Arrays.asList(0L), "", null);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/test/java/com/microsoft/azure/toolkit/lib/legacy/function/utils/CommandUtilsTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.legacy.function.utils;
7 |
8 | import org.apache.commons.lang3.SystemUtils;
9 | import org.junit.Test;
10 |
11 | import java.util.Arrays;
12 |
13 | import static org.junit.Assert.assertEquals;
14 |
15 | public class CommandUtilsTest {
16 |
17 | @Test
18 | public void isWindows() {
19 | assertEquals(SystemUtils.IS_OS_WINDOWS, CommandUtils.isWindows());
20 | }
21 |
22 | @Test
23 | public void getDefaultValidReturnCodes() throws Exception {
24 | assertEquals(2, CommandUtils.getValidReturnCodes().size());
25 | assertEquals(true, CommandUtils.getValidReturnCodes().contains(0L));
26 | }
27 |
28 | @Test
29 | public void getValidReturnCodes() {
30 | assertEquals(Arrays.asList(0L), CommandUtils.getDefaultValidReturnCodes());
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker:
--------------------------------------------------------------------------------
1 | mock-maker-inline
2 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/test/resources/ziptest.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azure-maven-plugins/59024998ee1b8f0461b405b418339cc9d3b4874c/azure-toolkit-libs/azure-toolkit-appservice-lib/src/test/resources/ziptest.zip
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-appservice-lib/src/test/resources/ziptest/test.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azure-maven-plugins/59024998ee1b8f0461b405b418339cc9d3b4874c/azure-toolkit-libs/azure-toolkit-appservice-lib/src/test/resources/ziptest/test.html
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-auth-lib/src/main/java/com/microsoft/azure/toolkit/lib/auth/AzureToolkitAuthenticationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.auth;
7 |
8 | import com.microsoft.azure.toolkit.lib.common.action.Action;
9 | import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException;
10 |
11 | public class AzureToolkitAuthenticationException extends AzureToolkitRuntimeException {
12 | public AzureToolkitAuthenticationException(String error) {
13 | super(error, Action.AUTHENTICATE);
14 | }
15 |
16 | public AzureToolkitAuthenticationException(String error, Throwable cause) {
17 | super(error, cause, Action.AUTHENTICATE);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/azure-toolkit-libs/azure-toolkit-auth-lib/src/main/java/com/microsoft/azure/toolkit/lib/auth/IAccountActions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | */
5 |
6 | package com.microsoft.azure.toolkit.lib.auth;
7 |
8 | import com.microsoft.azure.toolkit.lib.common.action.Action;
9 |
10 | public interface IAccountActions {
11 | Action.Id