├── .azure-pipelines └── build-and-upload.yml ├── .codecov.yml ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── no-response.yml └── workflows │ ├── RichCodeNav.yml │ └── no-response.yml ├── .gitignore ├── .idea ├── .gitignore ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml └── inspectionProfiles │ └── Project_Default.xml ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── LICENSE ├── README.md ├── SECURITY.md ├── azure-appservice-maven-plugin-lib ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── microsoft │ │ └── azure │ │ └── maven │ │ └── appservice │ │ ├── AbstractAppServiceMojo.java │ │ └── MavenDockerCredentialProvider.java │ └── test │ └── java │ └── com │ └── microsoft │ └── azure │ └── maven │ └── appservice │ └── AbstractAppServiceMojoTest.java ├── azure-container-apps-maven-plugin ├── README.md ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── microsoft │ │ └── azure │ │ └── maven │ │ └── containerapps │ │ ├── AbstractMojoBase.java │ │ ├── ConfigMojo.java │ │ ├── DeployMojo.java │ │ ├── config │ │ ├── AppContainerMavenConfig.java │ │ ├── DeploymentType.java │ │ └── IngressMavenConfig.java │ │ └── parser │ │ └── ConfigParser.java │ └── test │ └── java │ └── com │ └── microsoft │ └── azure │ └── maven │ └── containerapps │ ├── DeployMojoTest.java │ ├── configuration │ └── AppContainerMavenConfigTest.java │ └── parser │ └── ConfigParserTest.java ├── azure-functions-maven-plugin ├── CHANGELOG.md ├── README.md ├── pom.xml └── src │ ├── it │ ├── 0-http-trigger │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ ├── Function.java │ │ │ └── GsonFunctionBody.java │ ├── 1-storage-queue-trigger │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── Function.java │ ├── 2-timer-trigger │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── Function.java │ └── settings.xml │ ├── main │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── maven │ │ │ └── function │ │ │ ├── AbstractFunctionMojo.java │ │ │ ├── AddMojo.java │ │ │ ├── ConfigParser.java │ │ │ ├── DeployMojo.java │ │ │ ├── ListMojo.java │ │ │ ├── PackageMojo.java │ │ │ └── RunMojo.java │ └── resources │ │ ├── ApplicationInsights.xml │ │ └── META-INF │ │ └── plexus │ │ └── components.xml │ └── test │ ├── java │ └── com │ │ └── microsoft │ │ └── azure │ │ └── maven │ │ └── function │ │ ├── AddMojoTest.java │ │ ├── DeployMojoTest.java │ │ ├── ListMojoTest.java │ │ ├── MojoTestBase.java │ │ ├── PackageMojoTest.java │ │ ├── RunMojoTest.java │ │ └── invoker │ │ └── CommonUtils.java │ └── resources │ ├── mockito-extensions │ └── org.mockito.plugins.MockMaker │ ├── pom-with-settings.xml │ └── pom.xml ├── azure-maven-plugin-lib ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ ├── maven │ │ │ ├── AbstractAzureMojo.java │ │ │ ├── JavaProject.java │ │ │ ├── ProjectUtils.java │ │ │ ├── auth │ │ │ │ ├── AzureAuthFailureException.java │ │ │ │ └── MavenSettingHelper.java │ │ │ ├── exception │ │ │ │ └── MavenDecryptException.java │ │ │ ├── model │ │ │ │ ├── DeploymentResource.java │ │ │ │ ├── MavenAuthConfiguration.java │ │ │ │ ├── SubscriptionOption.java │ │ │ │ └── SubscriptionOption2.java │ │ │ ├── prompt │ │ │ │ ├── ConfigurationPrompter.java │ │ │ │ ├── DefaultPrompter.java │ │ │ │ ├── IPrompter.java │ │ │ │ ├── InputValidateResult.java │ │ │ │ └── SchemaValidator.java │ │ │ ├── queryer │ │ │ │ ├── MavenPluginQueryer.java │ │ │ │ ├── MavenPluginQueryerBatchModeDefaultImpl.java │ │ │ │ ├── QueryFactory.java │ │ │ │ └── TextIOMavenPluginQueryer.java │ │ │ └── utils │ │ │ │ ├── CustomTextIoStringListReader.java │ │ │ │ ├── MavenArtifactUtils.java │ │ │ │ ├── MavenAuthUtils.java │ │ │ │ ├── MavenConfigUtils.java │ │ │ │ ├── MavenUtils.java │ │ │ │ ├── PomUtils.java │ │ │ │ ├── SystemPropertyUtils.java │ │ │ │ ├── TemplateUtils.java │ │ │ │ ├── TextIOUtils.java │ │ │ │ └── XmlUtils.java │ │ │ └── toolkit │ │ │ └── maven │ │ │ └── common │ │ │ └── messager │ │ │ └── MavenAzureMessager.java │ └── resources │ │ ├── META-INF │ │ └── services │ │ │ └── com.microsoft.azure.toolkit.lib.common.messager.AzureMessagerProvider │ │ ├── MessageTemplates-container-apps.yaml │ │ ├── MessageTemplates-spring-apps.yaml │ │ ├── bundles │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ ├── message.properties │ │ │ └── operation.properties │ │ └── schema │ │ └── com │ │ └── microsoft │ │ └── azure │ │ └── toolkit │ │ └── maven │ │ ├── AzureAppServiceMavenPlugin.json │ │ ├── container-apps │ │ ├── App.json │ │ └── Environment.json │ │ └── spring-apps │ │ ├── App.json │ │ ├── Auth.json │ │ ├── Cluster.json │ │ └── Deployment.json │ └── test │ ├── java │ └── com │ │ └── microsoft │ │ └── azure │ │ └── maven │ │ ├── AbstractAzureMojoTest.java │ │ ├── TestHelper.java │ │ ├── prompt │ │ ├── DefaultPrompterTest.java │ │ ├── InputValidateResultTest.java │ │ └── SchemaValidatorTest.java │ │ └── utils │ │ ├── MavenUtilsTest.java │ │ ├── ResourcesUtilsTest.java │ │ └── XmlUtilsTest.java │ └── resources │ ├── mockito-extensions │ └── org.mockito.plugins.MockMaker │ ├── pom-1.xml │ ├── pom-2.xml │ ├── pom-3.xml │ ├── test-2.xml │ ├── test.xml │ ├── testApp.json │ └── testDeployment.json ├── azure-sdk-build-tool-maven-plugin ├── CHANGELOG.md ├── README.md ├── codegen │ └── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── sdk │ │ │ └── build │ │ │ └── tool │ │ │ ├── AnnotationProcessingTool.java │ │ │ ├── AzureDependencyMapping.java │ │ │ ├── DependencyCheckerTool.java │ │ │ ├── ReportGenerator.java │ │ │ ├── Tools.java │ │ │ ├── implementation │ │ │ ├── ApplicationInsightsClient.java │ │ │ ├── ApplicationInsightsClientBuilder.java │ │ │ ├── models │ │ │ │ ├── ExportResult.java │ │ │ │ ├── ExportResultException.java │ │ │ │ ├── MonitorBase.java │ │ │ │ ├── MonitorDomain.java │ │ │ │ ├── TelemetryErrorDetails.java │ │ │ │ ├── TelemetryEventData.java │ │ │ │ ├── TelemetryItem.java │ │ │ │ └── package-info.java │ │ │ └── package-info.java │ │ │ ├── models │ │ │ ├── BuildError.java │ │ │ ├── BuildErrorCode.java │ │ │ ├── BuildErrorLevel.java │ │ │ ├── BuildReport.java │ │ │ ├── MethodCallDetails.java │ │ │ ├── OutdatedDependency.java │ │ │ └── package-info.java │ │ │ ├── mojo │ │ │ ├── AzureSdkMojo.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── util │ │ │ ├── AnnotatedMethodCallerResult.java │ │ │ ├── AnnotationUtils.java │ │ │ ├── MavenUtils.java │ │ │ ├── MojoUtils.java │ │ │ ├── logging │ │ │ ├── ConsoleLogger.java │ │ │ ├── Logger.java │ │ │ ├── MojoLogger.java │ │ │ └── package-info.java │ │ │ └── package-info.java │ └── resources │ │ ├── azure-sdk-build-tool.properties │ │ └── strings.properties │ └── test │ ├── azure-sdk-build-tool-test │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── test │ │ └── annotation │ │ ├── AppConfigTestApp.java │ │ └── BetaApiTestApp.java │ └── java │ └── com │ └── microsoft │ └── azure │ └── sdk │ └── build │ └── tool │ ├── test │ └── models │ │ ├── AnnotationA.java │ │ ├── ClassA.java │ │ └── ClassB.java │ └── util │ └── AnnotationUtilsTests.java ├── azure-sfmesh-maven-plugin ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── microsoft │ │ └── azure │ │ └── maven │ │ └── servicefabric │ │ ├── AddGatewayMojo.java │ │ ├── AddNetworkMojo.java │ │ ├── AddSecretMojo.java │ │ ├── AddSecretValueMojo.java │ │ ├── AddServiceMojo.java │ │ ├── AddVolumeMojo.java │ │ ├── Constants.java │ │ ├── DeployMojo.java │ │ ├── DeployToClusterMojo.java │ │ ├── InitMojo.java │ │ ├── TelemetryEventType.java │ │ ├── TelemetryHelper.java │ │ ├── Utils.java │ │ └── YamlContent.java │ └── resources │ ├── ApplicationInsights.xml │ ├── app.yaml │ ├── gateway.yaml │ ├── network.yaml │ ├── secret.yaml │ ├── secretvalue.yaml │ ├── service.yaml │ └── volume.yaml ├── azure-spring-apps-maven-plugin ├── QUICKSTART.md ├── README.md ├── img │ ├── ExposePublicAccess.png │ └── SelectChildModules.png ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── maven │ │ │ └── springcloud │ │ │ ├── AbstractMojoBase.java │ │ │ ├── ConfigMojo.java │ │ │ ├── DeployMojo.java │ │ │ └── config │ │ │ ├── AppDeploymentMavenConfig.java │ │ │ ├── AppDeploymentRawConfig.java │ │ │ ├── AppRawConfig.java │ │ │ ├── ClusterRawConfig.java │ │ │ ├── ConfigurationParser.java │ │ │ └── ConfigurationUpdater.java │ └── resources │ │ ├── ApplicationInsights.xml │ │ └── schema │ │ └── com │ │ └── microsoft │ │ └── azure │ │ └── toolkit │ │ ├── App.json │ │ ├── Auth.json │ │ ├── Cluster.json │ │ └── Deployment.json │ └── test │ ├── java │ └── com │ │ └── microsoft │ │ └── azure │ │ └── maven │ │ └── springcloud │ │ ├── DeployMojoTest.java │ │ ├── TemplateUtilsTest.java │ │ ├── TestHelper.java │ │ ├── configuration │ │ ├── AppDeploymentMavenConfigTest.java │ │ ├── SpringCloudAppSettingsTest.java │ │ └── SpringCloudDeploymentRawConfigTest.java │ │ ├── exception │ │ └── AzureConfigurationExceptionTest.java │ │ ├── pom │ │ └── PomUtilsTest.java │ │ └── prompt │ │ └── ConfigurationPrompterTest.java │ └── resources │ ├── configured.xml │ ├── maven │ └── projects │ │ └── parent-project │ │ ├── core │ │ └── pom.xml │ │ ├── pom.xml │ │ └── service │ │ └── pom.xml │ ├── pom-4.xml │ ├── pom-5.xml │ └── test.xml ├── azure-toolkit-libs ├── azure-toolkit-applicationinsights-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── applicationinsights │ │ │ ├── ApplicationInsight.java │ │ │ ├── ApplicationInsightDraft.java │ │ │ ├── ApplicationInsightsModule.java │ │ │ ├── ApplicationInsightsServiceSubscription.java │ │ │ ├── AzureApplicationInsights.java │ │ │ └── task │ │ │ └── GetOrCreateApplicationInsightsTask.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-appservice-lib │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── azure │ │ │ │ └── toolkit │ │ │ │ └── lib │ │ │ │ ├── appservice │ │ │ │ ├── AppServiceAppBase.java │ │ │ │ ├── AppServiceResourceModule.java │ │ │ │ ├── AppServiceServiceSubscription.java │ │ │ │ ├── AzureAppService.java │ │ │ │ ├── IDeploymentSlotModule.java │ │ │ │ ├── config │ │ │ │ │ ├── AppServiceConfig.java │ │ │ │ │ ├── AppServicePlanConfig.java │ │ │ │ │ ├── DeploymentSlotConfig.java │ │ │ │ │ ├── FunctionAppConfig.java │ │ │ │ │ └── RuntimeConfig.java │ │ │ │ ├── deploy │ │ │ │ │ ├── DeployUtils.java │ │ │ │ │ ├── FTPFunctionDeployHandler.java │ │ │ │ │ ├── FlexFunctionDeployHandler.java │ │ │ │ │ ├── IFunctionDeployHandler.java │ │ │ │ │ ├── IOneDeploy.java │ │ │ │ │ ├── MSFunctionDeployHandler.java │ │ │ │ │ ├── RunFromBlobFunctionDeployHandler.java │ │ │ │ │ ├── RunFromZipFunctionDeployHandler.java │ │ │ │ │ └── ZIPFunctionDeployHandler.java │ │ │ │ ├── entity │ │ │ │ │ └── FunctionEntity.java │ │ │ │ ├── file │ │ │ │ │ ├── AppServiceKuduClient.java │ │ │ │ │ ├── AzureFunctionsAdminClient.java │ │ │ │ │ ├── IFileClient.java │ │ │ │ │ └── IProcessClient.java │ │ │ │ ├── function │ │ │ │ │ ├── AzureFunctions.java │ │ │ │ │ ├── FunctionApp.java │ │ │ │ │ ├── FunctionAppBase.java │ │ │ │ │ ├── FunctionAppDeploymentSlot.java │ │ │ │ │ ├── FunctionAppDeploymentSlotDraft.java │ │ │ │ │ ├── FunctionAppDeploymentSlotModule.java │ │ │ │ │ ├── FunctionAppDraft.java │ │ │ │ │ ├── FunctionAppModule.java │ │ │ │ │ ├── FunctionsServiceSubscription.java │ │ │ │ │ ├── core │ │ │ │ │ │ ├── AzureFunctionPackager.java │ │ │ │ │ │ ├── AzureFunctionPackagerBase.java │ │ │ │ │ │ ├── AzureFunctionsAnnotationConstants.java │ │ │ │ │ │ ├── ExtendedCustomBinding.java │ │ │ │ │ │ ├── FunctionAnnotation.java │ │ │ │ │ │ ├── FunctionAnnotationClass.java │ │ │ │ │ │ ├── FunctionMethod.java │ │ │ │ │ │ ├── FunctionProject.java │ │ │ │ │ │ └── IAnnotatable.java │ │ │ │ │ └── impl │ │ │ │ │ │ └── DefaultFunctionProject.java │ │ │ │ ├── model │ │ │ │ │ ├── AppServiceFile.java │ │ │ │ │ ├── ApplicationInsightsConfig.java │ │ │ │ │ ├── CommandOutput.java │ │ │ │ │ ├── ContainerAppFunctionConfiguration.java │ │ │ │ │ ├── CsmDeploymentStatus.java │ │ │ │ │ ├── DeployOptions.java │ │ │ │ │ ├── DeployType.java │ │ │ │ │ ├── DeploymentBuildStatus.java │ │ │ │ │ ├── DiagnosticConfig.java │ │ │ │ │ ├── DockerConfiguration.java │ │ │ │ │ ├── ErrorEntity.java │ │ │ │ │ ├── FlexConsumptionConfiguration.java │ │ │ │ │ ├── FunctionAppConfig.java │ │ │ │ │ ├── FunctionAppDockerRuntime.java │ │ │ │ │ ├── FunctionAppLinuxRuntime.java │ │ │ │ │ ├── FunctionAppRuntime.java │ │ │ │ │ ├── FunctionAppWindowsRuntime.java │ │ │ │ │ ├── FunctionDeployType.java │ │ │ │ │ ├── KuduDeploymentResult.java │ │ │ │ │ ├── LogLevel.java │ │ │ │ │ ├── OperatingSystem.java │ │ │ │ │ ├── PricingTier.java │ │ │ │ │ ├── ProcessInfo.java │ │ │ │ │ ├── PublishingProfile.java │ │ │ │ │ ├── Runtime.java │ │ │ │ │ ├── StorageAuthenticationMethod.java │ │ │ │ │ ├── TunnelStatus.java │ │ │ │ │ ├── WebAppArtifact.java │ │ │ │ │ ├── WebAppDockerRuntime.java │ │ │ │ │ ├── WebAppLinuxRuntime.java │ │ │ │ │ ├── WebAppRuntime.java │ │ │ │ │ └── WebAppWindowsRuntime.java │ │ │ │ ├── plan │ │ │ │ │ ├── AppServicePlan.java │ │ │ │ │ ├── AppServicePlanDraft.java │ │ │ │ │ └── AppServicePlanModule.java │ │ │ │ ├── task │ │ │ │ │ ├── CreateOrUpdateFunctionAppTask.java │ │ │ │ │ ├── CreateOrUpdateWebAppTask.java │ │ │ │ │ ├── DeployFunctionAppTask.java │ │ │ │ │ ├── DeployWebAppTask.java │ │ │ │ │ └── StreamingLogTask.java │ │ │ │ ├── utils │ │ │ │ │ ├── AppServiceConfigUtils.java │ │ │ │ │ ├── AppServiceUtils.java │ │ │ │ │ ├── FunctionCliResolver.java │ │ │ │ │ └── Utils.java │ │ │ │ └── webapp │ │ │ │ │ ├── AzureWebApp.java │ │ │ │ │ ├── WebApp.java │ │ │ │ │ ├── WebAppBase.java │ │ │ │ │ ├── WebAppDeploymentSlot.java │ │ │ │ │ ├── WebAppDeploymentSlotDraft.java │ │ │ │ │ ├── WebAppDeploymentSlotModule.java │ │ │ │ │ ├── WebAppDraft.java │ │ │ │ │ ├── WebAppModule.java │ │ │ │ │ └── WebAppServiceSubscription.java │ │ │ │ └── legacy │ │ │ │ ├── appservice │ │ │ │ ├── AppServiceUtils.java │ │ │ │ ├── DeploymentSlotSetting.java │ │ │ │ ├── DeploymentType.java │ │ │ │ ├── DockerImageType.java │ │ │ │ └── handlers │ │ │ │ │ └── artifact │ │ │ │ │ └── FTPUploader.java │ │ │ │ ├── docker │ │ │ │ └── IDockerCredentialProvider.java │ │ │ │ └── function │ │ │ │ ├── AzureStorageHelper.java │ │ │ │ ├── Constants.java │ │ │ │ ├── bindings │ │ │ │ ├── Binding.java │ │ │ │ ├── BindingEnum.java │ │ │ │ ├── BindingFactory.java │ │ │ │ ├── BindingSerializer.java │ │ │ │ └── ExtendedCustomBinding.java │ │ │ │ ├── configurations │ │ │ │ ├── FunctionConfiguration.java │ │ │ │ ├── FunctionExtensionVersion.java │ │ │ │ ├── Retry.java │ │ │ │ └── RuntimeConfiguration.java │ │ │ │ ├── handlers │ │ │ │ ├── AnnotationHandler.java │ │ │ │ ├── AnnotationHandlerImpl.java │ │ │ │ ├── CommandHandler.java │ │ │ │ ├── CommandHandlerImpl.java │ │ │ │ ├── FunctionCoreToolsHandler.java │ │ │ │ └── FunctionCoreToolsHandlerImpl.java │ │ │ │ ├── template │ │ │ │ ├── BindingConfiguration.java │ │ │ │ ├── BindingTemplate.java │ │ │ │ ├── BindingsTemplate.java │ │ │ │ ├── FunctionSettingTemplate.java │ │ │ │ ├── FunctionTemplate.java │ │ │ │ ├── FunctionTemplates.java │ │ │ │ ├── TemplateMetadata.java │ │ │ │ ├── TemplateResources.java │ │ │ │ └── ValidatorTemplate.java │ │ │ │ └── utils │ │ │ │ ├── CommandUtils.java │ │ │ │ ├── DateUtils.java │ │ │ │ └── FunctionUtils.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── com.microsoft.azure.toolkit.lib.AzService │ │ │ ├── bindings.json │ │ │ ├── resources.json │ │ │ ├── schema │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── azure │ │ │ │ └── toolkit │ │ │ │ └── appservice │ │ │ │ ├── AppServicePlan.json │ │ │ │ └── CreateAppServicePlan.json │ │ │ └── templates.json │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── legacy │ │ │ ├── appservice │ │ │ └── handlers │ │ │ │ └── artifact │ │ │ │ └── FTPUploaderTest.java │ │ │ └── function │ │ │ ├── handlers │ │ │ ├── AnnotationHandlerImplTest.java │ │ │ ├── CommandHandlerImplTest.java │ │ │ └── FunctionCoreToolsHandlerImplTest.java │ │ │ └── utils │ │ │ └── CommandUtilsTest.java │ │ └── resources │ │ ├── mockito-extensions │ │ └── org.mockito.plugins.MockMaker │ │ ├── ziptest.zip │ │ └── ziptest │ │ └── test.html ├── azure-toolkit-auth-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── auth │ │ │ ├── Account.java │ │ │ ├── AuthConfiguration.java │ │ │ ├── AuthType.java │ │ │ ├── AzureAccount.java │ │ │ ├── AzureCloud.java │ │ │ ├── AzureEnvironmentUtils.java │ │ │ ├── AzureToolkitAuthenticationException.java │ │ │ ├── IAccountActions.java │ │ │ ├── SharedTokenCacheAccount.java │ │ │ ├── cli │ │ │ ├── AzureCliAccount.java │ │ │ ├── AzureCliSubscription.java │ │ │ └── AzureCliUtils.java │ │ │ ├── devicecode │ │ │ └── DeviceCodeAccount.java │ │ │ ├── managedidentity │ │ │ └── ManagedIdentityAccount.java │ │ │ ├── oauth │ │ │ └── OAuthAccount.java │ │ │ └── serviceprincipal │ │ │ └── ServicePrincipalAccount.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-cognitiveservices-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── cognitiveservices │ │ │ ├── AzureCognitiveServices.java │ │ │ ├── CognitiveAccount.java │ │ │ ├── CognitiveAccountDraft.java │ │ │ ├── CognitiveAccountModule.java │ │ │ ├── CognitiveDeployment.java │ │ │ ├── CognitiveDeploymentDraft.java │ │ │ ├── CognitiveDeploymentModule.java │ │ │ ├── CognitiveServicesSubscription.java │ │ │ └── model │ │ │ ├── AccountModel.java │ │ │ ├── AccountSku.java │ │ │ ├── DeploymentModel.java │ │ │ ├── DeploymentSku.java │ │ │ └── ModelSku.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-common-lib │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── azure │ │ │ │ └── toolkit │ │ │ │ └── lib │ │ │ │ ├── AzService.java │ │ │ │ ├── Azure.java │ │ │ │ ├── AzureConfiguration.java │ │ │ │ ├── account │ │ │ │ ├── IAccount.java │ │ │ │ └── IAzureAccount.java │ │ │ │ ├── common │ │ │ │ ├── DataStore.java │ │ │ │ ├── Executable.java │ │ │ │ ├── IProject.java │ │ │ │ ├── action │ │ │ │ │ ├── Action.java │ │ │ │ │ ├── ActionGroup.java │ │ │ │ │ ├── ActionInstance.java │ │ │ │ │ ├── AzureActionManager.java │ │ │ │ │ ├── AzureActionManagerProvider.java │ │ │ │ │ └── IActionGroup.java │ │ │ │ ├── bundle │ │ │ │ │ ├── AzureBundle.java │ │ │ │ │ ├── AzureString.java │ │ │ │ │ └── CustomDecoratable.java │ │ │ │ ├── cache │ │ │ │ │ ├── Cache1.java │ │ │ │ │ ├── CacheEvict.java │ │ │ │ │ ├── CacheManager.java │ │ │ │ │ ├── Cacheable.java │ │ │ │ │ ├── LRUStack.java │ │ │ │ │ ├── Preload.java │ │ │ │ │ └── Preloader.java │ │ │ │ ├── event │ │ │ │ │ ├── AzureEvent.java │ │ │ │ │ └── AzureEventBus.java │ │ │ │ ├── exception │ │ │ │ │ ├── AzureExecutionException.java │ │ │ │ │ ├── AzureToolkitException.java │ │ │ │ │ ├── AzureToolkitRuntimeException.java │ │ │ │ │ ├── CommandExecuteException.java │ │ │ │ │ ├── InvalidConfigurationException.java │ │ │ │ │ ├── StreamingDiagnosticsException.java │ │ │ │ │ ├── SystemException.java │ │ │ │ │ └── UserException.java │ │ │ │ ├── form │ │ │ │ │ ├── AzureForm.java │ │ │ │ │ ├── AzureFormInput.java │ │ │ │ │ └── AzureValidationInfo.java │ │ │ │ ├── messager │ │ │ │ │ ├── AzureHtmlMessage.java │ │ │ │ │ ├── AzureMessage.java │ │ │ │ │ ├── AzureMessageBundle.java │ │ │ │ │ ├── AzureMessager.java │ │ │ │ │ ├── AzureMessagerProvider.java │ │ │ │ │ ├── ExceptionNotification.java │ │ │ │ │ ├── ExceptionNotificationAspect.java │ │ │ │ │ ├── IAzureMessage.java │ │ │ │ │ └── IAzureMessager.java │ │ │ │ ├── model │ │ │ │ │ ├── AbstractAzResource.java │ │ │ │ │ ├── AbstractAzResourceModule.java │ │ │ │ │ ├── AbstractAzService.java │ │ │ │ │ ├── AbstractAzServiceSubscription.java │ │ │ │ │ ├── AbstractConnectionStringAzResource.java │ │ │ │ │ ├── AbstractConnectionStringAzResourceModule.java │ │ │ │ │ ├── AbstractEmulatableAzResource.java │ │ │ │ │ ├── AbstractEmulatableAzResourceModule.java │ │ │ │ │ ├── Availability.java │ │ │ │ │ ├── AzComponent.java │ │ │ │ │ ├── AzResource.java │ │ │ │ │ ├── AzResourceModule.java │ │ │ │ │ ├── Deletable.java │ │ │ │ │ ├── Emulatable.java │ │ │ │ │ ├── ExpandableParameter.java │ │ │ │ │ ├── IArtifact.java │ │ │ │ │ ├── Refreshable.java │ │ │ │ │ ├── Region.java │ │ │ │ │ ├── Startable.java │ │ │ │ │ ├── Subscription.java │ │ │ │ │ └── page │ │ │ │ │ │ └── ItemPage.java │ │ │ │ ├── operation │ │ │ │ │ ├── AzureOperation.java │ │ │ │ │ ├── AzureOperationAspect.java │ │ │ │ │ ├── MethodOperation.java │ │ │ │ │ ├── Operation.java │ │ │ │ │ ├── OperationBase.java │ │ │ │ │ ├── OperationBundle.java │ │ │ │ │ ├── OperationContext.java │ │ │ │ │ ├── OperationException.java │ │ │ │ │ ├── OperationListener.java │ │ │ │ │ ├── OperationManager.java │ │ │ │ │ ├── OperationThreadContext.java │ │ │ │ │ └── SimpleOperation.java │ │ │ │ ├── proxy │ │ │ │ │ ├── ProxyInfo.java │ │ │ │ │ └── ProxyManager.java │ │ │ │ ├── task │ │ │ │ │ ├── AzureRxTaskManager.java │ │ │ │ │ ├── AzureTask.java │ │ │ │ │ ├── AzureTaskManager.java │ │ │ │ │ ├── AzureTaskManagerProvider.java │ │ │ │ │ └── ICommittable.java │ │ │ │ ├── telemetry │ │ │ │ │ ├── AzureTelemeter.java │ │ │ │ │ ├── AzureTelemetry.java │ │ │ │ │ ├── AzureTelemetryClient.java │ │ │ │ │ └── AzureTelemetryConfigProvider.java │ │ │ │ ├── utils │ │ │ │ │ ├── CommandUtils.java │ │ │ │ │ ├── Debouncer.java │ │ │ │ │ ├── InstallationIdUtils.java │ │ │ │ │ ├── JsonUtils.java │ │ │ │ │ ├── NetUtils.java │ │ │ │ │ ├── ProcessEnvironmentProvider.java │ │ │ │ │ ├── StreamingLogSupport.java │ │ │ │ │ ├── TailingDebouncer.java │ │ │ │ │ ├── TextUtils.java │ │ │ │ │ ├── UrlStreamingLog.java │ │ │ │ │ ├── Utils.java │ │ │ │ │ └── aspect │ │ │ │ │ │ ├── ExpressionUtils.java │ │ │ │ │ │ └── MethodInvocation.java │ │ │ │ ├── validator │ │ │ │ │ ├── SchemaValidator.java │ │ │ │ │ └── ValidationMessage.java │ │ │ │ └── view │ │ │ │ │ └── IView.java │ │ │ │ └── resource │ │ │ │ ├── AzureResources.java │ │ │ │ ├── GenericResource.java │ │ │ │ ├── GenericResourceModule.java │ │ │ │ ├── ResourceDeployment.java │ │ │ │ ├── ResourceDeploymentDraft.java │ │ │ │ ├── ResourceDeploymentModule.java │ │ │ │ ├── ResourceGroup.java │ │ │ │ ├── ResourceGroupConfig.java │ │ │ │ ├── ResourceGroupDraft.java │ │ │ │ ├── ResourceGroupModule.java │ │ │ │ ├── ResourcesServiceSubscription.java │ │ │ │ ├── message │ │ │ │ └── ISenderReceiver.java │ │ │ │ └── task │ │ │ │ └── CreateResourceGroupTask.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── com.microsoft.azure.toolkit.lib.AzService │ │ │ └── schema │ │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ ├── appservice │ │ │ ├── AppServiceName.json │ │ │ ├── AppServicePlanName.json │ │ │ ├── DeploymentSlotName.json │ │ │ └── Runtime.json │ │ │ └── common │ │ │ ├── AuthConfiguration.json │ │ │ ├── AzureEnvironment.json │ │ │ ├── NonEmptyString.json │ │ │ ├── ResourceGroupName.json │ │ │ └── UUID.json │ │ └── test │ │ └── java │ │ └── com │ │ └── microsoft │ │ └── azure │ │ └── toolkit │ │ └── lib │ │ ├── common │ │ └── telemetry │ │ │ └── AzureTelemetryClientTest.java │ │ └── legacy │ │ └── common │ │ └── AzureHtmlMessagePatternTest.java ├── azure-toolkit-compute-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ ├── compute │ │ │ ├── AzureCompute.java │ │ │ ├── ComputeServiceSubscription.java │ │ │ └── virtualmachine │ │ │ │ ├── VirtualMachine.java │ │ │ │ ├── VirtualMachineDraft.java │ │ │ │ ├── VirtualMachineModule.java │ │ │ │ ├── VmImage.java │ │ │ │ ├── VmImageOffer.java │ │ │ │ ├── VmImagePublisher.java │ │ │ │ ├── VmImageSku.java │ │ │ │ ├── VmSize.java │ │ │ │ ├── model │ │ │ │ ├── AuthenticationType.java │ │ │ │ ├── OperatingSystem.java │ │ │ │ └── SpotConfig.java │ │ │ │ └── task │ │ │ │ └── CreateVirtualMachineTask.java │ │ │ └── network │ │ │ ├── AzureNetwork.java │ │ │ ├── NetworkServiceSubscription.java │ │ │ ├── networksecuritygroup │ │ │ ├── NetworkSecurityGroup.java │ │ │ ├── NetworkSecurityGroupDraft.java │ │ │ ├── NetworkSecurityGroupModule.java │ │ │ └── SecurityRule.java │ │ │ ├── publicipaddress │ │ │ ├── PublicIpAddress.java │ │ │ ├── PublicIpAddressDraft.java │ │ │ └── PublicIpAddressModule.java │ │ │ └── virtualnetwork │ │ │ ├── Network.java │ │ │ ├── NetworkDraft.java │ │ │ ├── NetworkModule.java │ │ │ └── Subnet.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-containerapps-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── containerapps │ │ │ ├── AzureContainerApps.java │ │ │ ├── AzureContainerAppsServiceSubscription.java │ │ │ ├── config │ │ │ ├── ContainerAppConfig.java │ │ │ └── ContainerAppsEnvironmentConfig.java │ │ │ ├── containerapp │ │ │ ├── ContainerApp.java │ │ │ ├── ContainerAppDraft.java │ │ │ ├── ContainerAppModule.java │ │ │ ├── Replica.java │ │ │ ├── ReplicaContainer.java │ │ │ ├── ReplicaContainerModule.java │ │ │ ├── ReplicaModule.java │ │ │ ├── Revision.java │ │ │ ├── RevisionDraft.java │ │ │ └── RevisionModule.java │ │ │ ├── environment │ │ │ ├── ContainerAppsEnvironment.java │ │ │ ├── ContainerAppsEnvironmentDraft.java │ │ │ └── ContainerAppsEnvironmentModule.java │ │ │ ├── model │ │ │ ├── EnvironmentType.java │ │ │ ├── IngressConfig.java │ │ │ ├── ResourceConfiguration.java │ │ │ ├── RevisionMode.java │ │ │ ├── TransportMethod.java │ │ │ ├── WorkloadProfile.java │ │ │ └── WorkloadProfileType.java │ │ │ └── task │ │ │ └── DeployContainerAppTask.java │ │ └── resources │ │ ├── META-INF │ │ └── services │ │ │ └── com.microsoft.azure.toolkit.lib.AzService │ │ └── template │ │ └── aca │ │ ├── artifact-dockerfile │ │ └── source-dockerfile ├── azure-toolkit-containerregistry-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── containerregistry │ │ │ ├── Artifact.java │ │ │ ├── ArtifactModule.java │ │ │ ├── AzureContainerRegistry.java │ │ │ ├── AzureContainerRegistryModule.java │ │ │ ├── AzureContainerRegistryServiceSubscription.java │ │ │ ├── ContainerRegistry.java │ │ │ ├── ContainerRegistryDraft.java │ │ │ ├── RegistryTaskRunStreamingLog.java │ │ │ ├── Repository.java │ │ │ ├── RepositoryModule.java │ │ │ ├── Tag.java │ │ │ ├── TagModule.java │ │ │ ├── config │ │ │ └── ContainerRegistryConfig.java │ │ │ └── model │ │ │ └── Sku.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-containerservice-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── containerservice │ │ │ ├── AzureContainerService.java │ │ │ ├── ContainerServiceSubscription.java │ │ │ ├── KubernetesCluster.java │ │ │ ├── KubernetesClusterAgentPool.java │ │ │ ├── KubernetesClusterAgentPoolModule.java │ │ │ ├── KubernetesClusterDraft.java │ │ │ ├── KubernetesClusterModule.java │ │ │ └── model │ │ │ ├── AgentPoolMode.java │ │ │ ├── ContainerServiceNetworkProfile.java │ │ │ ├── IpFamily.java │ │ │ ├── LoadBalancerSku.java │ │ │ ├── NetworkMode.java │ │ │ ├── NetworkPlugin.java │ │ │ ├── NetworkPolicy.java │ │ │ ├── OsType.java │ │ │ ├── OutboundType.java │ │ │ ├── PowerState.java │ │ │ └── VirtualMachineSize.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-cosmos-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── cosmos │ │ │ ├── AzureCosmosService.java │ │ │ ├── CosmosDBAccount.java │ │ │ ├── CosmosDBAccountDraft.java │ │ │ ├── CosmosDBAccountModule.java │ │ │ ├── CosmosServiceSubscription.java │ │ │ ├── ICosmosCollection.java │ │ │ ├── ICosmosDatabase.java │ │ │ ├── ICosmosDatabaseDraft.java │ │ │ ├── ICosmosDocument.java │ │ │ ├── ICosmosDocumentContainer.java │ │ │ ├── cassandra │ │ │ ├── CassandraCosmosDBAccount.java │ │ │ ├── CassandraKeyspace.java │ │ │ ├── CassandraKeyspaceDraft.java │ │ │ ├── CassandraKeyspaceModule.java │ │ │ ├── CassandraTable.java │ │ │ ├── CassandraTableDraft.java │ │ │ └── CassandraTableModule.java │ │ │ ├── model │ │ │ ├── CassandraDatabaseAccountConnectionString.java │ │ │ ├── CosmosDBAccountConnectionString.java │ │ │ ├── DatabaseAccountConnectionStrings.java │ │ │ ├── DatabaseAccountKeys.java │ │ │ ├── DatabaseAccountKind.java │ │ │ ├── DatabaseConfig.java │ │ │ ├── MongoDatabaseAccountConnectionString.java │ │ │ ├── SqlDatabaseAccountConnectionString.java │ │ │ └── ThroughputConfig.java │ │ │ ├── mongo │ │ │ ├── MongoCollection.java │ │ │ ├── MongoCollectionDraft.java │ │ │ ├── MongoCollectionModule.java │ │ │ ├── MongoCosmosDBAccount.java │ │ │ ├── MongoDatabase.java │ │ │ ├── MongoDatabaseDraft.java │ │ │ ├── MongoDatabaseModule.java │ │ │ ├── MongoDocument.java │ │ │ ├── MongoDocumentDraft.java │ │ │ └── MongoDocumentModule.java │ │ │ └── sql │ │ │ ├── SqlContainer.java │ │ │ ├── SqlContainerDraft.java │ │ │ ├── SqlContainerModule.java │ │ │ ├── SqlCosmosDBAccount.java │ │ │ ├── SqlDatabase.java │ │ │ ├── SqlDatabaseDraft.java │ │ │ ├── SqlDatabaseModule.java │ │ │ ├── SqlDocument.java │ │ │ ├── SqlDocumentDraft.java │ │ │ └── SqlDocumentModule.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-database-lib │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── microsoft │ │ └── azure │ │ └── toolkit │ │ └── lib │ │ └── database │ │ ├── DatabaseServerConfig.java │ │ ├── FirewallRuleConfig.java │ │ ├── JdbcUrl.java │ │ ├── entity │ │ ├── IDatabase.java │ │ ├── IDatabaseServer.java │ │ └── IFirewallRule.java │ │ └── utils │ │ └── DatabaseTemplateUtils.java ├── azure-toolkit-eventhubs-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── eventhubs │ │ │ ├── AzureEventHubsNamespace.java │ │ │ ├── EventHubsInstance.java │ │ │ ├── EventHubsInstanceModule.java │ │ │ ├── EventHubsNamespace.java │ │ │ ├── EventHubsNamespaceModule.java │ │ │ └── EventHubsNamespaceSubscription.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-identity-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── identities │ │ │ ├── AzureManagedIdentity.java │ │ │ ├── AzureManagedIdentityModule.java │ │ │ ├── AzureManagedIdentitySubscription.java │ │ │ ├── Identity.java │ │ │ ├── ManagedIdentitySupport.java │ │ │ └── model │ │ │ └── IdentityConfiguration.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-keyvault-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── keyvault │ │ │ ├── AzureKeyVault.java │ │ │ ├── Credential.java │ │ │ ├── CredentialVersion.java │ │ │ ├── KeyVault.java │ │ │ ├── KeyVaultDraft.java │ │ │ ├── KeyVaultModule.java │ │ │ ├── KeyVaultSubscription.java │ │ │ ├── certificate │ │ │ ├── Certificate.java │ │ │ ├── CertificateDraft.java │ │ │ ├── CertificateModule.java │ │ │ ├── CertificateVersion.java │ │ │ ├── CertificateVersionDraft.java │ │ │ └── CertificateVersionModule.java │ │ │ ├── key │ │ │ ├── Key.java │ │ │ ├── KeyDraft.java │ │ │ ├── KeyModule.java │ │ │ ├── KeyVersion.java │ │ │ ├── KeyVersionDraft.java │ │ │ └── KeyVersionModule.java │ │ │ └── secret │ │ │ ├── Secret.java │ │ │ ├── SecretDraft.java │ │ │ ├── SecretModule.java │ │ │ ├── SecretVersion.java │ │ │ ├── SecretVersionDraft.java │ │ │ └── SecretVersionModule.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-monitor-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── monitor │ │ │ ├── AzureLogAnalyticsWorkspace.java │ │ │ ├── LogAnalyticsServiceWorkspaceSubscription.java │ │ │ ├── LogAnalyticsWorkspace.java │ │ │ ├── LogAnalyticsWorkspaceConfig.java │ │ │ ├── LogAnalyticsWorkspaceDraft.java │ │ │ └── LogAnalyticsWorkspaceModule.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-mysql-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── mysql │ │ │ ├── AzureMySql.java │ │ │ ├── MySqlDatabase.java │ │ │ ├── MySqlDatabaseModule.java │ │ │ ├── MySqlFirewallRule.java │ │ │ ├── MySqlFirewallRuleDraft.java │ │ │ ├── MySqlFirewallRuleModule.java │ │ │ ├── MySqlServer.java │ │ │ ├── MySqlServerDraft.java │ │ │ ├── MySqlServerModule.java │ │ │ └── MySqlServiceSubscription.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-mysql-single-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── mysql │ │ │ └── single │ │ │ ├── AzureMySql.java │ │ │ ├── MySqlDatabase.java │ │ │ ├── MySqlDatabaseModule.java │ │ │ ├── MySqlFirewallRule.java │ │ │ ├── MySqlFirewallRuleDraft.java │ │ │ ├── MySqlFirewallRuleModule.java │ │ │ ├── MySqlServer.java │ │ │ ├── MySqlServerDraft.java │ │ │ ├── MySqlServerModule.java │ │ │ └── MySqlServiceSubscription.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-postgre-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── postgre │ │ │ ├── AzurePostgreSql.java │ │ │ ├── PostgreSqlDatabase.java │ │ │ ├── PostgreSqlDatabaseModule.java │ │ │ ├── PostgreSqlFirewallRule.java │ │ │ ├── PostgreSqlFirewallRuleDraft.java │ │ │ ├── PostgreSqlFirewallRuleModule.java │ │ │ ├── PostgreSqlServer.java │ │ │ ├── PostgreSqlServerDraft.java │ │ │ ├── PostgreSqlServerModule.java │ │ │ └── PostgreSqlServiceSubscription.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-postgre-single-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── postgre │ │ │ └── single │ │ │ ├── AzurePostgreSql.java │ │ │ ├── PostgreSqlDatabase.java │ │ │ ├── PostgreSqlDatabaseModule.java │ │ │ ├── PostgreSqlFirewallRule.java │ │ │ ├── PostgreSqlFirewallRuleDraft.java │ │ │ ├── PostgreSqlFirewallRuleModule.java │ │ │ ├── PostgreSqlServer.java │ │ │ ├── PostgreSqlServerDraft.java │ │ │ ├── PostgreSqlServerModule.java │ │ │ └── PostgreSqlServiceSubscription.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-redis-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── redis │ │ │ ├── AzureRedis.java │ │ │ ├── RedisCache.java │ │ │ ├── RedisCacheDraft.java │ │ │ ├── RedisCacheModule.java │ │ │ ├── RedisServiceSubscription.java │ │ │ └── model │ │ │ ├── PricingTier.java │ │ │ └── RedisConfig.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-servicebus-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── servicebus │ │ │ ├── AzureServiceBusNamespace.java │ │ │ ├── ServiceBusNamespace.java │ │ │ ├── ServiceBusNamespaceModule.java │ │ │ ├── ServiceBusNamespaceSubscription.java │ │ │ ├── model │ │ │ └── ServiceBusInstance.java │ │ │ ├── queue │ │ │ ├── ServiceBusQueue.java │ │ │ └── ServiceBusQueueModule.java │ │ │ └── topic │ │ │ ├── ServiceBusTopic.java │ │ │ └── ServiceBusTopicModule.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-servicelinker-lib │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── microsoft │ │ └── azure │ │ └── toolkit │ │ └── lib │ │ └── servicelinker │ │ ├── ServiceLinker.java │ │ ├── ServiceLinkerConsumer.java │ │ └── ServiceLinkerModule.java ├── azure-toolkit-springcloud-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── springcloud │ │ │ ├── AzureSpringCloud.java │ │ │ ├── SpringCloudApp.java │ │ │ ├── SpringCloudAppDraft.java │ │ │ ├── SpringCloudAppInstance.java │ │ │ ├── SpringCloudAppInstanceModule.java │ │ │ ├── SpringCloudAppModule.java │ │ │ ├── SpringCloudCluster.java │ │ │ ├── SpringCloudClusterDraft.java │ │ │ ├── SpringCloudClusterModule.java │ │ │ ├── SpringCloudDeployment.java │ │ │ ├── SpringCloudDeploymentDraft.java │ │ │ ├── SpringCloudDeploymentInstanceEntity.java │ │ │ ├── SpringCloudDeploymentModule.java │ │ │ ├── SpringCloudServiceSubscription.java │ │ │ ├── Utils.java │ │ │ ├── config │ │ │ ├── SpringCloudAppConfig.java │ │ │ ├── SpringCloudClusterConfig.java │ │ │ └── SpringCloudDeploymentConfig.java │ │ │ ├── model │ │ │ ├── Sku.java │ │ │ ├── SpringCloudDeploymentStatus.java │ │ │ └── SpringCloudPersistentDisk.java │ │ │ └── task │ │ │ └── DeploySpringCloudAppTask.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-sqlserver-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── sqlserver │ │ │ ├── AzureSqlServer.java │ │ │ ├── MicrosoftSqlDatabase.java │ │ │ ├── MicrosoftSqlDatabaseModule.java │ │ │ ├── MicrosoftSqlFirewallRule.java │ │ │ ├── MicrosoftSqlFirewallRuleDraft.java │ │ │ ├── MicrosoftSqlFirewallRuleModule.java │ │ │ ├── MicrosoftSqlServer.java │ │ │ ├── MicrosoftSqlServerDraft.java │ │ │ ├── MicrosoftSqlServerModule.java │ │ │ └── MicrosoftSqlServiceSubscription.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService ├── azure-toolkit-storage-lib │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── lib │ │ │ └── storage │ │ │ ├── AzureStorageAccount.java │ │ │ ├── AzuriteStorageAccount.java │ │ │ ├── ConnectionStringStorageAccount.java │ │ │ ├── ConnectionStringStorageAccountModule.java │ │ │ ├── IStorageAccount.java │ │ │ ├── StorageAccount.java │ │ │ ├── StorageAccountDraft.java │ │ │ ├── StorageAccountModule.java │ │ │ ├── StorageServiceSubscription.java │ │ │ ├── blob │ │ │ ├── BlobContainer.java │ │ │ ├── BlobContainerDraft.java │ │ │ ├── BlobContainerModule.java │ │ │ ├── BlobFile.java │ │ │ ├── BlobFileDraft.java │ │ │ ├── BlobFileModule.java │ │ │ └── IBlobFile.java │ │ │ ├── model │ │ │ ├── AccessTier.java │ │ │ ├── Kind.java │ │ │ ├── Performance.java │ │ │ ├── Redundancy.java │ │ │ ├── StorageAccountConfig.java │ │ │ └── StorageFile.java │ │ │ ├── queue │ │ │ ├── Queue.java │ │ │ ├── QueueDraft.java │ │ │ └── QueueModule.java │ │ │ ├── share │ │ │ ├── IShareFile.java │ │ │ ├── Share.java │ │ │ ├── ShareDraft.java │ │ │ ├── ShareFile.java │ │ │ ├── ShareFileDraft.java │ │ │ ├── ShareFileModule.java │ │ │ └── ShareModule.java │ │ │ └── table │ │ │ ├── Table.java │ │ │ ├── TableDraft.java │ │ │ └── TableModule.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.microsoft.azure.toolkit.lib.AzService └── pom.xml ├── azure-webapp-maven-plugin ├── CHANGELOG.md ├── README.md ├── pom.xml └── src │ ├── it │ ├── 0-invalid-auth │ │ ├── invoker.properties │ │ └── pom.xml │ ├── 1-no-runtime-setting │ │ ├── invoker.properties │ │ └── pom.xml │ ├── 10-windows-jar │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── index.jsp │ ├── 11-windows-war │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── index.jsp │ ├── 12-windows-auto-slot │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── index.jsp │ ├── 13-linux-war-slot │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── index.jsp │ ├── 14-linux-zip │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── hello │ │ │ └── HelloWorld.java │ ├── 15-v2-linux-zip │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── hello │ │ │ └── HelloWorld.java │ ├── 16-v2-linux-war │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── index.jsp │ ├── 17-v2-windows-ftp │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── index.jsp │ ├── 18-v2-private-registry │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ └── setup.groovy │ ├── 2-private-docker-hub │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ └── setup.groovy │ ├── 3-private-registry │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ └── setup.groovy │ ├── 4-public-docker-hub │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ └── setup.groovy │ ├── 5-runtime-conflict │ │ ├── invoker.properties │ │ └── pom.xml │ ├── 6-windows-ftp │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── index.jsp │ ├── 7-linux-ftp │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── index.jsp │ ├── 8-linux-jar-jre8 │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── hello │ │ │ └── HelloWorld.java │ ├── 9-linux-war │ │ ├── cleanup.groovy │ │ ├── pom.xml │ │ ├── setup.groovy │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── index.jsp │ └── settings.xml │ ├── main │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── maven │ │ │ └── webapp │ │ │ ├── AbstractWebAppMojo.java │ │ │ ├── ConfigMojo.java │ │ │ ├── DeployMojo.java │ │ │ ├── WebAppConfiguration.java │ │ │ ├── configuration │ │ │ ├── ContainerSetting.java │ │ │ ├── DeployTargetType.java │ │ │ ├── Deployment.java │ │ │ ├── DeploymentSlotConfig.java │ │ │ ├── MavenRuntimeConfig.java │ │ │ └── SchemaVersion.java │ │ │ ├── handlers │ │ │ └── WebAppPomHandler.java │ │ │ ├── parser │ │ │ └── ConfigParser.java │ │ │ ├── serializer │ │ │ ├── ConfigurationSerializer.java │ │ │ └── V2ConfigurationSerializer.java │ │ │ ├── task │ │ │ └── DeployExternalResourcesTask.java │ │ │ └── utils │ │ │ ├── FTPUtils.java │ │ │ ├── Utils.java │ │ │ └── XMLUtils.java │ └── resources │ │ ├── ApplicationInsights.xml │ │ ├── plugin.properties │ │ ├── schema │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── toolkit │ │ │ └── WebAppConfiguration.json │ │ └── web.config.template │ └── test │ ├── java │ └── com │ │ └── microsoft │ │ └── azure │ │ └── maven │ │ └── webapp │ │ ├── DeployMojoTest.java │ │ └── utils │ │ └── TestUtils.java │ └── resources │ ├── artifacthandlerv2 │ └── test.html │ ├── mockito-extensions │ └── org.mockito.plugins.MockMaker │ ├── pom-linux.xml │ ├── pom-simple.xml │ ├── pom-slot.xml │ └── pom-windows.xml ├── build-tools ├── pom.xml └── src │ └── main │ └── resources │ ├── checkstyle │ ├── checkstyle-suppressions.xml │ ├── checkstyle.xml │ └── java.header │ └── findbugs │ └── findbugs-exclude.xml ├── ci ├── appveyor.yml ├── appveyor_function.yml ├── appveyor_function_e2e.yml ├── appveyor_sdk_build_tool.yml ├── appveyor_spring.yml ├── appveyor_webapp.yml └── ps │ ├── e2etest.ps1 │ └── errorNotificationSender.ps1 ├── docs ├── common-configuration.md ├── images │ ├── archtype-version.png │ ├── azure-maven-plugins-version.png │ └── update-plugin-in-pom.png ├── validate-java-templates-local.md ├── web-app-samples.md └── web-config.md ├── mvnw ├── mvnw.cmd └── pom.xml /.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: "60...80" 3 | precision: 2 4 | round: down 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Plugin name and version 2 | 3 | ### Plugin configuration in your `pom.xml` 4 | 5 | ### Expected behavior 6 | 7 | ### Actual behavior 8 | 9 | ### Steps to reproduce the problem 10 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | What does this implement/fix? Explain your changes. 2 | --------------------------------------------------- 3 | … 4 | 5 | 6 | Does this close any currently open issues? 7 | ------------------------------------------ 8 | 9 | 10 | 11 | 12 | Any relevant logs, screenshots, error output, etc.? 13 | ------------------------------------- 14 | 15 | 16 | Any other comments? 17 | ------------------- 18 | … 19 | 20 | Has this been tested? 21 | --------------------------- 22 | - [ ] Tested 23 | -------------------------------------------------------------------------------- /.github/no-response.yml: -------------------------------------------------------------------------------- 1 | daysUntilClose: 30 2 | responseRequiredLabel: need-more-info 3 | closeComment: > 4 | This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further. 5 | -------------------------------------------------------------------------------- /.github/workflows/RichCodeNav.yml: -------------------------------------------------------------------------------- 1 | name: RichNavIndexing 2 | on: 3 | pull_request: 4 | push: 5 | branches: 6 | - develop 7 | - validate/* 8 | 9 | jobs: 10 | richnav: 11 | runs-on: windows-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: microsoft/RichCodeNavIndexer@v0.1 15 | with: 16 | languages: java 17 | repo-token: ${{ github.token }} 18 | -------------------------------------------------------------------------------- /.github/workflows/no-response.yml: -------------------------------------------------------------------------------- 1 | name: No Response 2 | 3 | # **What it does**: Closes issues where the original author doesn't respond to a request for information. 4 | # **Why we have it**: To remove the need for maintainers to remember to check back on issues periodically to see if contributors have responded. 5 | # **Who does it impact**: Everyone that works on docs or docs-internal. 6 | 7 | on: 8 | issue_comment: 9 | types: [created] 10 | schedule: 11 | - cron: '0 0 * * *' 12 | 13 | jobs: 14 | noResponse: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: lee-dohm/no-response@v0.5.0 18 | with: 19 | token: ${{ github.token }} 20 | daysUntilClose: 14 # Number of days of inactivity before an Issue is closed for lack of response 21 | responseRequiredLabel: "need more info" # Label indicating that a response from the original author is required 22 | closeComment: > 23 | This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build output 2 | target/ 3 | *.class 4 | 5 | # Log file 6 | *.log 7 | 8 | # BlueJ files 9 | *.ctxt 10 | 11 | # Mobile Tools for Java (J2ME) 12 | .mtj.tmp/ 13 | 14 | # Package Files # 15 | *.jar 16 | *.war 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | *.factorypath 22 | 23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 24 | hs_err_pid* 25 | 26 | # IDE 27 | .idea/ 28 | !.idea/inspectionProfiles/* 29 | !.idea/codeStyles/* 30 | !.idea/.gitignore* 31 | *.iml 32 | .classpath 33 | .project 34 | .settings/ 35 | .checkstyle 36 | .vscode/ 37 | 38 | # macOS 39 | .DS_Store 40 | 41 | # mvnw 42 | !.mvn/wrapper/maven-wrapper.jar 43 | 44 | # integration test 45 | */src/it/*/bin 46 | 47 | jacoco.exec 48 | bin/ 49 | 50 | # ignore azure-sdk-usage-report.txt 51 | **/azure-sdk-usage-report.txt 52 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | /azure/ 10 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-maven-plugins/59024998ee1b8f0461b405b418339cc9d3b4874c/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /azure-container-apps-maven-plugin/src/main/java/com/microsoft/azure/maven/containerapps/config/AppContainerMavenConfig.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.maven.containerapps.config; 7 | 8 | import com.azure.resourcemanager.appcontainers.models.EnvironmentVar; 9 | import lombok.Data; 10 | import org.apache.commons.lang3.StringUtils; 11 | 12 | import javax.annotation.Nullable; 13 | import java.util.List; 14 | 15 | @Data 16 | public class AppContainerMavenConfig { 17 | 18 | @Nullable 19 | private Double cpu; 20 | @Nullable 21 | private String memory; 22 | private String type; 23 | @Nullable 24 | private String image; 25 | @Nullable 26 | private List environment; 27 | @Nullable 28 | private String directory; 29 | 30 | public DeploymentType getDeploymentType() { 31 | return StringUtils.isBlank(type) ? DeploymentType.IMAGE : DeploymentType.valueOf(type.toUpperCase()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /azure-container-apps-maven-plugin/src/main/java/com/microsoft/azure/maven/containerapps/config/DeploymentType.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.maven.containerapps.config; 2 | 3 | public enum DeploymentType { 4 | CODE, 5 | ARTIFACT, 6 | IMAGE 7 | } 8 | -------------------------------------------------------------------------------- /azure-container-apps-maven-plugin/src/main/java/com/microsoft/azure/maven/containerapps/config/IngressMavenConfig.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.maven.containerapps.config; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class IngressMavenConfig { 7 | private Integer targetPort; 8 | private Boolean external; 9 | } 10 | -------------------------------------------------------------------------------- /azure-functions-maven-plugin/README.md: -------------------------------------------------------------------------------- 1 | # Maven Plugin for Azure Functions 2 | 3 | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-functions-maven-plugin.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-functions-maven-plugin%22) 4 | 5 | The Maven Plugin for Azure Functions provides seamless integration into Maven projects. 6 | 7 | ## Documentation 8 | 9 | Visit our [Wiki](https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Functions) for detailed documentation. 10 | 11 | ## Feedback and Questions 12 | To report bugs or request new features, file issues on [Issues](https://github.com/microsoft/azure-maven-plugins/issues). Or, ask questions on [Stack Overflow with tag azure-java-tools](https://stackoverflow.com/questions/tagged/azure-java-tools). 13 | 14 | ## Data and Telemetry 15 | This project collects usage data and sends it to Microsoft to help improve our products and services. 16 | Read Microsoft's [privacy statement](https://privacy.microsoft.com/en-us/privacystatement) to learn more. 17 | If you would like to opt out of sending telemetry data to Microsoft, you can set `allowTelemetry` to false in the plugin configuration. 18 | Please read our [documents](https://aka.ms/azure-maven-config) to find more details. -------------------------------------------------------------------------------- /azure-functions-maven-plugin/src/it/0-http-trigger/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.function.invoker.CommonUtils 7 | 8 | // Verify Azure Functions 9 | def url = "https://maven-functions-it-${timestamp}-0.azurewebsites.net/api/HttpTrigger-Java?json={\"body\":\"Azure\"}".toURL() 10 | 11 | CommonUtils.runVerification(new Runnable() { 12 | @Override 13 | void run() { 14 | def response = url.getText() 15 | assert response == "Hello, Azure" 16 | } 17 | }) 18 | 19 | // Clean up resources created in test 20 | CommonUtils.deleteAzureResourceGroup("maven-functions-it-${timestamp}-rg-0", false) 21 | 22 | return true 23 | -------------------------------------------------------------------------------- /azure-functions-maven-plugin/src/it/0-http-trigger/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.function.invoker.CommonUtils 7 | 8 | CommonUtils.azureLogin() 9 | 10 | CommonUtils.deleteAzureResourceGroup("maven-functions-it-${timestamp}-rg-0", true) 11 | 12 | return true 13 | -------------------------------------------------------------------------------- /azure-functions-maven-plugin/src/it/0-http-trigger/src/main/java/com/microsoft/azure/GsonFunctionBody.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; 7 | 8 | public class GsonFunctionBody { 9 | public String body; 10 | } -------------------------------------------------------------------------------- /azure-functions-maven-plugin/src/it/1-storage-queue-trigger/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.function.invoker.CommonUtils 7 | 8 | CommonUtils.azureLogin() 9 | 10 | CommonUtils.deleteAzureResourceGroup("maven-functions-it-${timestamp}-rg-1", true) 11 | 12 | return true 13 | -------------------------------------------------------------------------------- /azure-functions-maven-plugin/src/it/1-storage-queue-trigger/src/main/java/com/microsoft/azure/Function.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; 7 | 8 | import com.microsoft.azure.functions.annotation.*; 9 | import com.microsoft.azure.functions.*; 10 | 11 | public class Function { 12 | @FunctionName("StorageQueueTriggerJava") 13 | @QueueOutput(name = "$return", queueName = "out", connection = "AzureWebJobsDashboard") 14 | public String queueHandler( 15 | @QueueTrigger(name = "in", queueName = "trigger", connection = "AzureWebJobsDashboard") String in, 16 | final ExecutionContext context 17 | ) { 18 | context.getLogger().info("Java Queue trigger function processed a message: " + in); 19 | return in; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /azure-functions-maven-plugin/src/it/2-timer-trigger/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.function.invoker.CommonUtils 7 | 8 | CommonUtils.azureLogin() 9 | 10 | CommonUtils.deleteAzureResourceGroup("maven-functions-it-${timestamp}-rg-2", true) 11 | 12 | return true 13 | -------------------------------------------------------------------------------- /azure-functions-maven-plugin/src/it/2-timer-trigger/src/main/java/com/microsoft/azure/Function.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; 7 | 8 | import java.time.*; 9 | import com.microsoft.azure.functions.annotation.*; 10 | import com.microsoft.azure.functions.*; 11 | 12 | public class Function { 13 | @FunctionName("TimerTriggerJava") 14 | @QueueOutput(name = "$return", queueName = "out", connection = "AzureWebJobsDashboard") 15 | public String run( 16 | @TimerTrigger(name = "timerInfo", schedule = "*/5 * * * * *") String timerInfo, 17 | final ExecutionContext context 18 | ) { 19 | context.getLogger().info("Java Timer trigger function executed at: " + LocalDateTime.now()); 20 | return "successfully triggered"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /azure-functions-maven-plugin/src/main/resources/ApplicationInsights.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ${azure.ai.ikey} 5 | 6 | 7 | 8 | 9 | 10 | 1 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /azure-functions-maven-plugin/src/test/java/com/microsoft/azure/maven/function/MojoTestBase.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.maven.function; 7 | 8 | import org.apache.maven.plugin.Mojo; 9 | import org.apache.maven.plugin.testing.MojoRule; 10 | import org.junit.Rule; 11 | 12 | import java.io.File; 13 | 14 | public class MojoTestBase { 15 | @Rule 16 | public MojoRule rule = new MojoRule() { 17 | @Override 18 | protected void before() throws Throwable { 19 | } 20 | 21 | @Override 22 | protected void after() { 23 | } 24 | }; 25 | 26 | protected Mojo getMojoFromPom(final String filename, final String goal) throws Exception { 27 | final File pom = new File(this.getClass().getResource(filename).toURI()); 28 | return rule.lookupMojo(goal, pom); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /azure-functions-maven-plugin/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/main/java/com/microsoft/azure/maven/auth/AzureAuthFailureException.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.maven.auth; 7 | 8 | public class AzureAuthFailureException extends Exception { 9 | private static final long serialVersionUID = 6870052716860684958L; 10 | 11 | public AzureAuthFailureException(String message) { 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/main/java/com/microsoft/azure/maven/exception/MavenDecryptException.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.maven.exception; 7 | 8 | public class MavenDecryptException extends Exception { 9 | private static final long serialVersionUID = 5207024853556212112L; 10 | 11 | public MavenDecryptException(String message) { 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/main/java/com/microsoft/azure/maven/model/MavenAuthConfiguration.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.maven.model; 7 | 8 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | @Setter 13 | @Getter 14 | @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) 15 | public class MavenAuthConfiguration { 16 | private String serverId; 17 | private String type; 18 | private String environment; 19 | private String client; 20 | private String tenant; 21 | private String key; 22 | private String certificate; 23 | private String certificatePassword; 24 | } 25 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/main/java/com/microsoft/azure/maven/prompt/InputValidateResult.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.maven.prompt; 7 | 8 | public class InputValidateResult { 9 | private T obj; 10 | private String errorMessage; 11 | 12 | public T getObj() { 13 | return obj; 14 | } 15 | 16 | public String getErrorMessage() { 17 | return errorMessage; 18 | } 19 | 20 | public static InputValidateResult wrap(T obj) { 21 | final InputValidateResult res = new InputValidateResult<>(); 22 | res.obj = obj; 23 | return res; 24 | } 25 | 26 | public static InputValidateResult error(String errorMessage) { 27 | final InputValidateResult res = new InputValidateResult<>(); 28 | res.errorMessage = errorMessage; 29 | return res; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/main/java/com/microsoft/azure/maven/queryer/QueryFactory.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.maven.queryer; 7 | 8 | import org.apache.maven.settings.Settings; 9 | 10 | public class QueryFactory { 11 | public static MavenPluginQueryer getQueryer(Settings settings) { 12 | return (settings != null && !settings.isInteractiveMode()) ? 13 | new MavenPluginQueryerBatchModeDefaultImpl() : 14 | new TextIOMavenPluginQueryer(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.common.messager.AzureMessagerProvider: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.maven.common.messager.MavenAzureMessager$Provider -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/main/resources/bundles/com/microsoft/azure/toolkit/message.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-maven-plugins/59024998ee1b8f0461b405b418339cc9d3b4874c/azure-maven-plugin-lib/src/main/resources/bundles/com/microsoft/azure/toolkit/message.properties -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/main/resources/schema/com/microsoft/azure/toolkit/maven/container-apps/Environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Environment", 4 | "description": "Azure Container App Environment", 5 | "type": "object", 6 | "properties": { 7 | "environmentName": { 8 | "description": "The name of your Azure Container App Environment", 9 | "type": "string", 10 | "pattern": "^(?!.*--)[a-z0-9]([-a-z0-9]*[a-z0-9])$", 11 | "minLength": 2, 12 | "maxLength": 60 13 | }, 14 | "resourceGroup": { 15 | "description": "Name for Azure Resource Group", 16 | "type": "string", 17 | "pattern": "^(?!.*--)[a-zA-Z0-9\\.\\_\\-\\(\\)]+$", 18 | "minLength": 2, 19 | "maxLength": 90 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/main/resources/schema/com/microsoft/azure/toolkit/maven/spring-apps/App.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "App", 4 | "description": "An app in Azure Spring Apps", 5 | "type": "object", 6 | "properties": { 7 | "appName": { 8 | "description": "The app name", 9 | "type": "string", 10 | "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])$", 11 | "minLength": 4, 12 | "maxLength": 32 13 | }, 14 | "isPublic": { 15 | "description": "Public accessible to this app", 16 | "type": "boolean", 17 | "default": false 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/main/resources/schema/com/microsoft/azure/toolkit/maven/spring-apps/Cluster.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Cluster", 4 | "description": "Azure Spring Apps instance", 5 | "type": "object", 6 | "properties": { 7 | "clusterName": { 8 | "description": "The name of your Azure Spring Apps", 9 | "type": "string", 10 | "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])$", 11 | "minLength": 4, 12 | "maxLength": 32 13 | }, 14 | "resourceGroup": { 15 | "description": "Name for Azure Resource Group", 16 | "type": "string", 17 | "pattern": "^[a-zA-Z0-9\\.\\_\\-\\(\\)]+$", 18 | "minLength": 2, 19 | "maxLength": 90 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/test/java/com/microsoft/azure/maven/TestHelper.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.maven; 7 | 8 | import java.io.File; 9 | import java.io.IOException; 10 | import java.util.Collections; 11 | import java.util.List; 12 | import java.util.stream.Collectors; 13 | 14 | import com.google.common.base.Preconditions; 15 | import org.apache.maven.model.Model; 16 | import org.apache.maven.model.io.DefaultModelReader; 17 | import org.apache.maven.model.io.ModelReader; 18 | 19 | public class TestHelper { 20 | public static String joinIntegers(List integers) { 21 | Preconditions.checkNotNull(integers, "Parameter 'integers' should not be null or empty."); 22 | return integers.stream().map(t -> t.toString()).collect(Collectors.joining(",")); 23 | } 24 | 25 | public static Model readMavenModel(File pomFile) throws IOException { 26 | final ModelReader reader = new DefaultModelReader(); 27 | return reader.read(pomFile, Collections.emptyMap()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/test/java/com/microsoft/azure/maven/prompt/InputValidateResultTest.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.maven.prompt; 7 | 8 | import org.junit.Test; 9 | 10 | import static org.junit.Assert.assertEquals; 11 | import static org.junit.Assert.assertNotNull; 12 | import static org.junit.Assert.assertNull; 13 | import static org.junit.Assert.assertSame; 14 | 15 | public class InputValidateResultTest { 16 | @Test 17 | public void testWrap() { 18 | final Object obj = new Object(); 19 | final InputValidateResult wrapper = InputValidateResult.wrap(obj); 20 | assertNotNull(wrapper); 21 | assertSame(obj, wrapper.getObj()); 22 | assertNull(wrapper.getErrorMessage()); 23 | } 24 | 25 | @Test 26 | public void testError() { 27 | final InputValidateResult wrapper = InputValidateResult.error("message"); 28 | assertNotNull(wrapper); 29 | assertEquals("message", wrapper.getErrorMessage()); 30 | assertNull(wrapper.getObj()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/test/resources/test-2.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/test/resources/testApp.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "App", 4 | "description": "An app in Azure Spring Apps", 5 | "type": "object", 6 | "properties": { 7 | "appName": { 8 | "description": "The app name", 9 | "type": "string", 10 | "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])$", 11 | "maxLength": 32 12 | }, 13 | "isPublic": { 14 | "description": "Public accessible to this app", 15 | "type": "boolean", 16 | "default": false 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /azure-maven-plugin-lib/src/test/resources/testDeployment.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Deployment", 4 | "description": "A deployment in an Azure Spring App", 5 | "type": "object", 6 | "properties": { 7 | "deploymentName": { 8 | "description": "The deployment name", 9 | "type": "string", 10 | "pattern": "^.*$" 11 | }, 12 | "cpu": { 13 | "description": "cpu cores", 14 | "type": "integer", 15 | "default": 1, 16 | "minimum": 1, 17 | "maximum": 4 18 | }, 19 | "memoryInGB": { 20 | "description": "memory in GB", 21 | "type": "integer", 22 | "default": 1, 23 | "minimum": 1, 24 | "maximum": 8 25 | }, 26 | "instanceCount": { 27 | "description": "instance count", 28 | "type": "integer", 29 | "default": 1, 30 | "minimum": 1, 31 | "maximum": 10 32 | }, 33 | "jvmOptions": { 34 | "type": "string" 35 | }, 36 | "testProperties": { 37 | "type": "array" 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Release History 2 | 3 | ## 1.0.0-SNAPSHOT (Unreleased) 4 | 5 | ### Features Added 6 | This is the initial preview of the Azure SDK build tool Maven plugin. Please see [README](https://github.com/Microsoft/azure-maven-plugins/blob/main/azure-sdk-build-tool-maven-plugin/README.md) 7 | for the full list of features offered by the tool. 8 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/codegen/README.md: -------------------------------------------------------------------------------- 1 | ``` yaml 2 | input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/applicationinsights/data-plane/Monitor.Exporters/preview/v2.1/swagger.json 3 | java: true 4 | output-folder: ../ 5 | namespace: com.azure.sdk.build.tool.implementation 6 | generate-client-interfaces: false 7 | service-interface-as-public: true 8 | license-header: MICROSOFT_MIT_SMALL 9 | add-context-parameter: true 10 | context-client-method-parameter: true 11 | directive: 12 | - rename-model: 13 | from: TrackResponse 14 | to: ExportResult 15 | ``` 16 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/java/com/microsoft/azure/sdk/build/tool/Tools.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.sdk.build.tool; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | * A class containing list of build tools that can be executed when the plugin is run. 11 | */ 12 | public class Tools { 13 | private static final List TOOLS = new ArrayList<>(); 14 | static { 15 | TOOLS.add(new DependencyCheckerTool()); 16 | TOOLS.add(new AnnotationProcessingTool()); 17 | } 18 | 19 | /** 20 | * Returns the list of tools available to run. 21 | * @return The list of tools. 22 | */ 23 | public static List getTools() { 24 | return TOOLS; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/java/com/microsoft/azure/sdk/build/tool/implementation/models/package-info.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // Code generated by Microsoft (R) AutoRest Code Generator. 4 | 5 | /** 6 | * Package containing the data models for ApplicationInsightsClient. This document describes the protocol for client 7 | * requests and responses to the data collection endpoint. 8 | */ 9 | package com.microsoft.azure.sdk.build.tool.implementation.models; 10 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/java/com/microsoft/azure/sdk/build/tool/implementation/package-info.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // Code generated by Microsoft (R) AutoRest Code Generator. 4 | 5 | /** 6 | * Package containing the classes for ApplicationInsightsClient. This document describes the protocol for client 7 | * requests and responses to the data collection endpoint. 8 | */ 9 | package com.microsoft.azure.sdk.build.tool.implementation; 10 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/java/com/microsoft/azure/sdk/build/tool/models/BuildErrorLevel.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.sdk.build.tool.models; 5 | 6 | /** 7 | * Enumeration of build error severity level. 8 | */ 9 | public enum BuildErrorLevel { 10 | ERROR, 11 | WARNING; 12 | } 13 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/java/com/microsoft/azure/sdk/build/tool/models/package-info.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | /** 5 | * Package containing models used by the Azure SDK Build Tool. 6 | */ 7 | package com.microsoft.azure.sdk.build.tool.models; 8 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/java/com/microsoft/azure/sdk/build/tool/mojo/package-info.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | /** 5 | * Package containing the Maven plugin classes for the Azure SDK Build Tool. 6 | */ 7 | package com.microsoft.azure.sdk.build.tool.mojo; 8 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/java/com/microsoft/azure/sdk/build/tool/package-info.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | /** 5 | * Package containing classes used by the Azure SDK build tool. 6 | */ 7 | package com.microsoft.azure.sdk.build.tool; 8 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/java/com/microsoft/azure/sdk/build/tool/util/logging/package-info.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | /** 5 | * Package containing classes for logging. 6 | */ 7 | package com.microsoft.azure.sdk.build.tool.util.logging; 8 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/java/com/microsoft/azure/sdk/build/tool/util/package-info.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | /** 5 | * Package containing utility classes for the Azure SDK for Java build tool. 6 | */ 7 | package com.microsoft.azure.sdk.build.tool.util; 8 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/resources/azure-sdk-build-tool.properties: -------------------------------------------------------------------------------- 1 | name=${project.artifactId} 2 | version=${project.version} 3 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/main/resources/strings.properties: -------------------------------------------------------------------------------- 1 | # Error messages 2 | missingBomDependency = The azure-sdk-bom is not being used! 3 | outdatedBomDependency = The azure-sdk-bom is outdated - consider updating to the latest release! 4 | overrideBomVersion = The azure-sdk-bom version is ignored and a dependency version is explicitly specified. 5 | betaDependencyUsed = A beta dependency is used. 6 | 7 | deprecatedDirectDependency = A direct dependency of this project relies on a `com.microsoft.*` library. Consider upgrading to the `com.azure.*` library listed below: 8 | deprecatedIndirectDependency = A transitive dependency of this project relies on a `com.microsoft.*` library. Consider checking for a newer release of the following libraries: 9 | 10 | betaApiUsed = A method annotated with Beta is called! 11 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/test/azure-sdk-build-tool-test/src/main/java/com/test/annotation/BetaApiTestApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.test.annotation; 5 | 6 | import com.azure.cosmos.ChangeFeedProcessorBuilder; 7 | 8 | /** 9 | * Test @Beta annotation usage. 10 | */ 11 | public class BetaApiTestApp { 12 | public static void main(String[] args) { 13 | ChangeFeedProcessorBuilder changeFeedProcessorBuilder = new ChangeFeedProcessorBuilder(); 14 | // this is a beta API 15 | changeFeedProcessorBuilder.handleAllVersionsAndDeletesChanges(null); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/test/java/com/microsoft/azure/sdk/build/tool/test/models/AnnotationA.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.sdk.build.tool.test.models; 5 | 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface AnnotationA { 11 | } 12 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/test/java/com/microsoft/azure/sdk/build/tool/test/models/ClassA.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.sdk.build.tool.test.models; 5 | 6 | public class ClassA { 7 | 8 | @AnnotationA 9 | public void methodA() { 10 | // no-op 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /azure-sdk-build-tool-maven-plugin/src/test/java/com/microsoft/azure/sdk/build/tool/test/models/ClassB.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.sdk.build.tool.test.models; 5 | 6 | public class ClassB { 7 | 8 | public void methodB() { 9 | // calls through to ClassA.methodA(), which is annotated 10 | new ClassA().methodA(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /azure-sfmesh-maven-plugin/src/main/java/com/microsoft/azure/maven/servicefabric/TelemetryHelper.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.maven.servicefabric; 7 | 8 | import com.microsoft.applicationinsights.TelemetryClient; 9 | 10 | import org.apache.maven.plugin.logging.Log; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | public class TelemetryHelper { 15 | private static final TelemetryClient client = new TelemetryClient(); 16 | 17 | public static boolean sendEvent(TelemetryEventType type, String value, Log logger){ 18 | final Map properties = new HashMap(); 19 | properties.put("Description", value); 20 | try { 21 | client.trackEvent(type.getValue(), properties, null); 22 | client.flush(); 23 | Thread.sleep(1500); 24 | } catch (InterruptedException e) { 25 | logger.error(String.format("Failed sending telemetry event of type %s", type.getValue())); 26 | } 27 | return true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /azure-sfmesh-maven-plugin/src/main/resources/ApplicationInsights.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 58ef8eab-a250-4b11-aea8-36435e5be1a7 4 | 5 | False 6 | 7 | 8 | https://vortex.data.microsoft.com/collect/v1 9 | 10 | -------------------------------------------------------------------------------- /azure-sfmesh-maven-plugin/src/main/resources/app.yaml: -------------------------------------------------------------------------------- 1 | ## App Definition ## 2 | application: 3 | schemaVersion: SCHEMA_VERSION 4 | name: APP_NAME 5 | properties: 6 | description: APP_DESCRIPTION 7 | -------------------------------------------------------------------------------- /azure-sfmesh-maven-plugin/src/main/resources/gateway.yaml: -------------------------------------------------------------------------------- 1 | ## Gateway Definition ## 2 | gateway: 3 | schemaVersion: SCHEMA_VERSION 4 | name: GATEWAY_NAME 5 | properties: 6 | description: GATEWAY_DESCRIPTION 7 | sourceNetwork: 8 | name: SOURCE_NETWORK 9 | destinationNetwork: 10 | name: DESTINATION_NETWORK 11 | tcp: 12 | - name: TCP_NAME 13 | port: PORT 14 | destination: 15 | applicationName: APPLICATION_NAME 16 | serviceName: SERVICE_NAME 17 | endpointName: LISTENER_NAME 18 | -------------------------------------------------------------------------------- /azure-sfmesh-maven-plugin/src/main/resources/network.yaml: -------------------------------------------------------------------------------- 1 | ## Network Definition ## 2 | network: 3 | schemaVersion: SCHEMA_VERSION 4 | name: NETWORK_NAME 5 | properties: 6 | description: NETWORK_DESCRIPTION 7 | kind: NETWORK_KIND 8 | networkAddressPrefix: ADDRESS_PREFIX 9 | -------------------------------------------------------------------------------- /azure-sfmesh-maven-plugin/src/main/resources/secret.yaml: -------------------------------------------------------------------------------- 1 | ## Secret Definition ## 2 | secret: 3 | schemaVersion: SCHEMA_VERSION 4 | name: SECRET_NAME 5 | properties: 6 | kind: SECRET_KIND 7 | description: SECRET_DESCRIPTION 8 | contentType: SECRET_CONTENT_TYPE -------------------------------------------------------------------------------- /azure-sfmesh-maven-plugin/src/main/resources/secretvalue.yaml: -------------------------------------------------------------------------------- 1 | ## Secret Value Definition ## 2 | secretValue: 3 | schemaVersion: SCHEMA_VERSION 4 | name: SECRET_VALUE_NAME 5 | properties: 6 | value: SECRET_VALUE -------------------------------------------------------------------------------- /azure-sfmesh-maven-plugin/src/main/resources/service.yaml: -------------------------------------------------------------------------------- 1 | ## Service Definition ## 2 | application: 3 | schemaVersion: SCHEMA_VERSION 4 | name: APP_NAME 5 | properties: 6 | services: 7 | - name: SERVICE_NAME 8 | properties: 9 | description: SERVICE_DESCRIPTION 10 | osType: OS_TYPE 11 | codePackages: 12 | - name: CODE_PACKAGE_NAME 13 | image: DOCKER_IMAGE 14 | endpoints: 15 | - name: LISTENER_NAME 16 | port: LISTENER_PORT 17 | resources: 18 | requests: 19 | cpu: CPU_USAGE 20 | memoryInGB: MEMORY_USAGE 21 | replicaCount: REPLICA_COUNT 22 | networkRefs: 23 | - name: NETWORK_NAME 24 | endpointRefs: 25 | - name: LISTENER_NAME -------------------------------------------------------------------------------- /azure-sfmesh-maven-plugin/src/main/resources/volume.yaml: -------------------------------------------------------------------------------- 1 | ## Volume Definition ## 2 | volume: 3 | schemaVersion: SCHEMA_VERSION 4 | name: VOLUME_NAME 5 | properties: 6 | description: VOLUME_DESCRIPTION 7 | provider: VOLUME_PROVIDER 8 | azureFileParameters: 9 | shareName: VOLUME_SHARE_NAME 10 | accountName: VOLUME_ACCOUNT_NAME 11 | accountKey: VOLUME_ACCOUNT_KEY 12 | -------------------------------------------------------------------------------- /azure-spring-apps-maven-plugin/img/ExposePublicAccess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-maven-plugins/59024998ee1b8f0461b405b418339cc9d3b4874c/azure-spring-apps-maven-plugin/img/ExposePublicAccess.png -------------------------------------------------------------------------------- /azure-spring-apps-maven-plugin/img/SelectChildModules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-maven-plugins/59024998ee1b8f0461b405b418339cc9d3b4874c/azure-spring-apps-maven-plugin/img/SelectChildModules.png -------------------------------------------------------------------------------- /azure-spring-apps-maven-plugin/src/main/java/com/microsoft/azure/maven/springcloud/config/ClusterRawConfig.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.maven.springcloud.config; 7 | 8 | import com.microsoft.azure.toolkit.lib.springcloud.SpringCloudCluster; 9 | import lombok.Data; 10 | 11 | import javax.annotation.Nonnull; 12 | 13 | @Data 14 | public class ClusterRawConfig { 15 | private String subscriptionId; 16 | private String resourceGroup; // optional 17 | private String clusterName; 18 | private String region; 19 | private String sku; 20 | private String environment; 21 | private String environmentResourceGroup; 22 | 23 | public void saveSpringCluster(@Nonnull final SpringCloudCluster cluster) { 24 | this.setSubscriptionId(cluster.getSubscriptionId()); 25 | this.setResourceGroup(cluster.getResourceGroupName()); 26 | this.setClusterName(cluster.getName()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /azure-spring-apps-maven-plugin/src/main/resources/ApplicationInsights.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ${azure.ai.ikey} 5 | 6 | 1 7 | 8 | 9 | -------------------------------------------------------------------------------- /azure-spring-apps-maven-plugin/src/main/resources/schema/com/microsoft/azure/toolkit/App.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "App", 4 | "description": "An app in Azure Spring Apps", 5 | "type": "object", 6 | "properties": { 7 | "appName": { 8 | "description": "The app name", 9 | "type": "string", 10 | "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])$", 11 | "minLength": 4, 12 | "maxLength": 32 13 | }, 14 | "isPublic": { 15 | "description": "Public accessible to this app", 16 | "type": "boolean", 17 | "default": false 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /azure-spring-apps-maven-plugin/src/main/resources/schema/com/microsoft/azure/toolkit/Cluster.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Cluster", 4 | "description": "Azure Spring Apps instance", 5 | "type": "object", 6 | "properties": { 7 | "clusterName": { 8 | "description": "The name of your Azure Spring Apps", 9 | "type": "string", 10 | "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])$", 11 | "minLength": 4, 12 | "maxLength": 32 13 | }, 14 | "resourceGroup": { 15 | "description": "Name for Azure Resource Group", 16 | "type": "string", 17 | "pattern": "^[a-zA-Z0-9\\.\\_\\-\\(\\)]+$", 18 | "minLength": 2, 19 | "maxLength": 90 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /azure-spring-apps-maven-plugin/src/test/java/com/microsoft/azure/maven/springcloud/TestHelper.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.maven.springcloud; 7 | 8 | import org.apache.maven.model.Model; 9 | import org.apache.maven.model.io.DefaultModelReader; 10 | import org.apache.maven.model.io.ModelReader; 11 | 12 | import java.io.File; 13 | import java.io.IOException; 14 | import java.util.Collections; 15 | 16 | public class TestHelper { 17 | public static Model readMavenModel(File pomFile) throws IOException { 18 | final ModelReader reader = new DefaultModelReader(); 19 | return reader.read(pomFile, Collections.emptyMap()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /azure-spring-apps-maven-plugin/src/test/resources/maven/projects/parent-project/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.ms.test 6 | parent-project 7 | 1.0-SNAPSHOT 8 | pom 9 | 10 | parent-project 11 | 12 | http://www.example.com 13 | 14 | 15 | 16 | 17 | core 18 | service 19 | 20 | -------------------------------------------------------------------------------- /azure-spring-apps-maven-plugin/src/test/resources/pom-5.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.ms 5 | samples 6 | jar 7 | 1.0-SNAPSHOT 8 | java-project 9 | http://maven.apache.org 10 | 11 | 1.8 12 | 1.8 13 | 14 | UTF-8 15 | 16 | 17 | 18 | junit 19 | junit 20 | 3.8.1 21 | test 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-applicationinsights-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.applicationinsights.AzureApplicationInsights 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-appservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/appservice/IDeploymentSlotModule.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; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.model.AbstractAzResource; 9 | import com.microsoft.azure.toolkit.lib.common.model.AzResourceModule; 10 | 11 | public interface IDeploymentSlotModule, 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 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 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 TRY_AZURE = Action.TRY_AZURE; 12 | Action.Id SELECT_SUBS = Action.SELECT_SUBS; 13 | Action.Id AUTHENTICATE = Action.AUTHENTICATE; 14 | Action.Id SIGN_IN = Action.SIGN_IN; 15 | Action.Id SIGN_OUT = Action.SIGN_OUT; 16 | } 17 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-auth-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.auth.AzureAccount 2 | com.microsoft.azure.toolkit.lib.auth.AzureCloud 3 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-cognitiveservices-lib/src/main/java/com/microsoft/azure/toolkit/lib/cognitiveservices/model/AccountSku.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.cognitiveservices.model; 7 | 8 | import com.azure.resourcemanager.cognitiveservices.models.ResourceSku; 9 | import com.azure.resourcemanager.cognitiveservices.models.Sku; 10 | import lombok.Builder; 11 | import lombok.Data; 12 | import lombok.EqualsAndHashCode; 13 | 14 | @Data 15 | @Builder 16 | @EqualsAndHashCode 17 | public class AccountSku { 18 | private String name; 19 | private String tier; 20 | 21 | public static AccountSku fromSku(Sku sku) { 22 | return AccountSku.builder() 23 | .name(sku.name()) 24 | .tier(sku.tier().toString()) 25 | .build(); 26 | } 27 | 28 | public static AccountSku fromSku(ResourceSku sku) { 29 | return AccountSku.builder() 30 | .name(sku.name()) 31 | .tier(sku.tier()) 32 | .build(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-cognitiveservices-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.cognitiveservices.AzureCognitiveServices -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/AzService.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; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException; 9 | 10 | import javax.annotation.Nonnull; 11 | import javax.annotation.Nullable; 12 | 13 | public interface AzService { 14 | String getName(); 15 | 16 | void refresh(); 17 | 18 | @Nullable 19 | default E getById(@Nonnull String id) { 20 | throw new AzureToolkitRuntimeException("not supported"); 21 | } 22 | 23 | @Nullable 24 | default E getOrInitByConnectionString(@Nonnull String connectionString) { 25 | return null; 26 | } 27 | 28 | @Nullable 29 | default E getOrInitById(@Nonnull String id) { 30 | throw new AzureToolkitRuntimeException("not supported"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/account/IAccount.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.account; 7 | 8 | import com.azure.core.credential.TokenCredential; 9 | import com.azure.core.management.AzureEnvironment; 10 | import com.microsoft.azure.toolkit.lib.common.model.Subscription; 11 | 12 | import java.util.List; 13 | 14 | public interface IAccount { 15 | 16 | String getPortalUrl(); 17 | 18 | String getUsername(); 19 | 20 | String getClientId(); 21 | 22 | List getSubscriptions(); 23 | 24 | List getSelectedSubscriptions(); 25 | 26 | Subscription getSubscription(String subscriptionId); 27 | 28 | AzureEnvironment getEnvironment(); 29 | 30 | TokenCredential getTokenCredential(String subscriptionId); 31 | } 32 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/account/IAzureAccount.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.account; 7 | 8 | import com.microsoft.azure.toolkit.lib.AzService; 9 | import com.microsoft.azure.toolkit.lib.common.model.Region; 10 | 11 | import java.util.List; 12 | 13 | public interface IAzureAccount extends AzService { 14 | IAccount account(); 15 | 16 | boolean isLoggedIn(); 17 | 18 | boolean isLoggingIn(); 19 | 20 | List listRegions(String subscriptionId); 21 | } 22 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/Executable.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.common; 7 | 8 | @FunctionalInterface 9 | public interface Executable { 10 | T execute() throws Throwable; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/IProject.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.common; 7 | 8 | import java.nio.file.Path; 9 | import java.util.Collection; 10 | 11 | public interface IProject { 12 | Path getBaseDirectory(); 13 | 14 | Path getArtifactFile(); 15 | 16 | Path getBuildDirectory(); 17 | 18 | Path getClassesOutputDirectory(); 19 | 20 | Collection getProjectDependencies(); 21 | 22 | boolean isWarProject(); 23 | 24 | boolean isJarProject(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/action/AzureActionManagerProvider.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.common.action; 7 | 8 | @FunctionalInterface 9 | public interface AzureActionManagerProvider { 10 | AzureActionManager getActionManager(); 11 | } 12 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/bundle/CustomDecoratable.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.common.bundle; 2 | 3 | 4 | import com.microsoft.azure.toolkit.lib.common.messager.IAzureMessage; 5 | 6 | public interface CustomDecoratable { 7 | /** 8 | * @return null if not decoratable 9 | */ 10 | String decorate(IAzureMessage message); 11 | } 12 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/cache/Preload.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.common.cache; 7 | 8 | import java.lang.annotation.Documented; 9 | import java.lang.annotation.ElementType; 10 | import java.lang.annotation.Inherited; 11 | import java.lang.annotation.Retention; 12 | import java.lang.annotation.RetentionPolicy; 13 | import java.lang.annotation.Target; 14 | 15 | /** 16 | * to annotate methods that should be pre-executed at background 17 | * the annotated method should have no args and must be static or in a singleton class 18 | */ 19 | @Target(value = {ElementType.METHOD}) 20 | @Retention(value = RetentionPolicy.RUNTIME) 21 | @Inherited 22 | @Documented 23 | public @interface Preload { 24 | } 25 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/event/AzureEvent.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.common.event; 7 | 8 | import javax.annotation.Nonnull; 9 | import javax.annotation.Nullable; 10 | 11 | public interface AzureEvent { 12 | Object getSource(); 13 | 14 | @Nonnull 15 | String getType(); 16 | 17 | @Nullable 18 | Object getPayload(); 19 | } 20 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/exception/AzureExecutionException.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.common.exception; 7 | 8 | /** 9 | * @deprecated use {@link AzureToolkitException} or {@link AzureToolkitRuntimeException} instead 10 | */ 11 | @Deprecated 12 | public class AzureExecutionException extends Exception { 13 | public AzureExecutionException(String errorMessage, Throwable err) { 14 | super(errorMessage.toString(), err); 15 | } 16 | 17 | public AzureExecutionException(String errorMessage) { 18 | super(errorMessage); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/exception/CommandExecuteException.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.common.exception; 7 | 8 | public class CommandExecuteException extends AzureToolkitRuntimeException { 9 | private static final long serialVersionUID = 4582230448665092548L; 10 | 11 | public CommandExecuteException(String message) { 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/exception/InvalidConfigurationException.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.common.exception; 7 | 8 | public class InvalidConfigurationException extends AzureToolkitException { 9 | 10 | private static final long serialVersionUID = 3122420022403832460L; 11 | 12 | public InvalidConfigurationException(String message) { 13 | super(message); 14 | } 15 | 16 | public InvalidConfigurationException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/messager/AzureMessageBundle.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.common.messager; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.bundle.AzureBundle; 9 | import com.microsoft.azure.toolkit.lib.common.bundle.AzureString; 10 | import org.jetbrains.annotations.PropertyKey; 11 | 12 | import javax.annotation.Nonnull; 13 | 14 | public class AzureMessageBundle { 15 | private static final String BUNDLE = "bundles.com.microsoft.azure.toolkit.message"; 16 | 17 | private static final AzureBundle bundle = new AzureBundle(BUNDLE); 18 | 19 | public static AzureString message(@Nonnull @PropertyKey(resourceBundle = BUNDLE) String name, @Nonnull Object... params) { 20 | return AzureString.format(bundle, name, params); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/messager/AzureMessagerProvider.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.common.messager; 2 | 3 | import javax.annotation.Nonnull; 4 | 5 | @FunctionalInterface 6 | public interface AzureMessagerProvider { 7 | @Nonnull 8 | IAzureMessager getMessager(); 9 | } 10 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/messager/ExceptionNotification.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.common.messager; 7 | 8 | import java.lang.annotation.ElementType; 9 | import java.lang.annotation.Retention; 10 | import java.lang.annotation.RetentionPolicy; 11 | import java.lang.annotation.Target; 12 | 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Target({ElementType.METHOD}) 15 | public @interface ExceptionNotification { 16 | Class[] value() default {Throwable.class}; 17 | 18 | boolean throwAgain() default false; 19 | } 20 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/model/AbstractEmulatableAzResourceModule.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.common.model; 6 | 7 | import javax.annotation.Nonnull; 8 | 9 | public abstract class AbstractEmulatableAzResourceModule, P extends AzResource, R> 10 | extends AbstractAzResourceModule implements Emulatable { 11 | 12 | public AbstractEmulatableAzResourceModule(@Nonnull String name, @Nonnull P parent) { 13 | super(name, parent); 14 | } 15 | 16 | @Override 17 | public boolean isAuthRequiredForListing() { 18 | return !isEmulatorResource() && super.isAuthRequiredForListing(); 19 | } 20 | 21 | public boolean isAuthRequiredForCreating() { 22 | return !isEmulatorResource() && super.isAuthRequiredForListing(); 23 | } 24 | 25 | @Override 26 | public boolean isEmulatorResource() { 27 | return this.getParent() instanceof Emulatable && ((Emulatable) this.getParent()).isEmulatorResource(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/model/Availability.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.common.model; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.Getter; 10 | 11 | @Getter 12 | @AllArgsConstructor 13 | public class Availability { 14 | private boolean available; 15 | private String unavailabilityReason; 16 | private String unavailabilityMessage; 17 | 18 | public Availability(boolean available, String unavailabilityReason) { 19 | this.available = available; 20 | this.unavailabilityReason = unavailabilityReason; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/model/AzComponent.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.common.model; 2 | 3 | import javax.annotation.Nonnull; 4 | 5 | public interface AzComponent { 6 | 7 | @Nonnull 8 | String getName(); 9 | 10 | @Nonnull 11 | String getId(); 12 | 13 | @Nonnull 14 | String getResourceTypeName(); 15 | 16 | @Nonnull 17 | String getFullResourceType(); 18 | } 19 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/model/Deletable.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.common.model; 7 | 8 | public interface Deletable { 9 | void delete(); 10 | } 11 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/model/Emulatable.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.common.model; 7 | 8 | public interface Emulatable { 9 | boolean isEmulatorResource(); 10 | } 11 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/model/ExpandableParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the MIT License. See License.txt in the project root for 4 | license information. 5 | */ 6 | 7 | package com.microsoft.azure.toolkit.lib.common.model; 8 | 9 | import java.beans.Transient; 10 | 11 | public interface ExpandableParameter { 12 | @Transient 13 | boolean isExpandedValue(); 14 | } 15 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/model/IArtifact.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the MIT License. See License.txt in the project root for 4 | license information. 5 | */ 6 | 7 | package com.microsoft.azure.toolkit.lib.common.model; 8 | 9 | import lombok.Getter; 10 | 11 | import javax.annotation.Nonnull; 12 | import javax.annotation.Nullable; 13 | import java.io.File; 14 | 15 | public interface IArtifact { 16 | @Nullable 17 | File getFile(); 18 | 19 | @Nonnull 20 | static FileArtifact fromFile(@Nonnull final File file) { 21 | return new FileArtifact(file); 22 | } 23 | 24 | @Getter 25 | class FileArtifact implements IArtifact { 26 | @Nonnull 27 | private final File file; 28 | 29 | public FileArtifact(@Nonnull final File file) { 30 | this.file = file; 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/model/Refreshable.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.common.model; 7 | 8 | public interface Refreshable { 9 | void refresh(); 10 | } 11 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/model/Startable.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.common.model; 7 | 8 | public interface Startable extends AzResource { 9 | 10 | void start(); 11 | 12 | void stop(); 13 | 14 | void restart(); 15 | 16 | default boolean isStartable() { 17 | return this.getFormalStatus().isStopped(); 18 | } 19 | 20 | default boolean isStoppable() { 21 | return this.getFormalStatus().isRunning(); 22 | } 23 | 24 | default boolean isRestartable() { 25 | return this.isStoppable(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/operation/AzureOperation.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.common.operation; 7 | 8 | import java.lang.annotation.ElementType; 9 | import java.lang.annotation.Retention; 10 | import java.lang.annotation.RetentionPolicy; 11 | import java.lang.annotation.Target; 12 | 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Target({ElementType.METHOD}) 15 | public @interface AzureOperation { 16 | 17 | /** 18 | * alias for {@link #name()} 19 | */ 20 | String value() default ""; 21 | 22 | String name() default ""; 23 | 24 | /** 25 | * groovy expressions to compute the params dynamically. 26 | * e.g. groovy expression: {@code "this.webapp.id()" }, {@code "subscriptionId" } 27 | */ 28 | String[] params() default {}; 29 | 30 | /** 31 | * groovy expressions to compute the source object dynamically. 32 | * e.g. groovy expression: {@code "this.webapp" }, {@code "app" } 33 | */ 34 | String source() default ""; 35 | } 36 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/operation/OperationBundle.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.common.operation; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.bundle.AzureBundle; 9 | import com.microsoft.azure.toolkit.lib.common.bundle.AzureString; 10 | import org.jetbrains.annotations.PropertyKey; 11 | 12 | import javax.annotation.Nonnull; 13 | 14 | public class OperationBundle { 15 | public static final String BUNDLE = "bundles.com.microsoft.azure.toolkit.operation"; 16 | 17 | private static final AzureBundle bundle = new AzureBundle(BUNDLE); 18 | 19 | public static AzureString description(@Nonnull @PropertyKey(resourceBundle = BUNDLE) String name, @Nonnull Object... params) { 20 | return AzureString.format(bundle, name, params); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/operation/OperationException.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.common.operation; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException; 9 | import lombok.Getter; 10 | 11 | import java.util.Optional; 12 | 13 | @Getter 14 | public class OperationException extends AzureToolkitRuntimeException { 15 | private final Operation operation; 16 | 17 | public OperationException(final Operation operation, final Throwable cause) { 18 | super(cause); 19 | this.operation = operation; 20 | } 21 | 22 | @Override 23 | public String getMessage() { 24 | return Optional.ofNullable(operation.getDescription()).map(Object::toString).orElse(null); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/operation/OperationListener.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.common.operation; 7 | 8 | public interface OperationListener { 9 | default void beforeEnter(Operation operation, Object source) { 10 | } 11 | 12 | default void afterReturning(Operation operation, Object source) { 13 | } 14 | 15 | default void afterThrowing(Throwable e, Operation operation, Object source) { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/proxy/ProxyInfo.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.common.proxy; 7 | 8 | import lombok.Getter; 9 | import lombok.experimental.SuperBuilder; 10 | 11 | import javax.annotation.Nullable; 12 | 13 | @SuperBuilder 14 | @Getter 15 | public class ProxyInfo { 16 | private String source; 17 | private String host; 18 | private int port; 19 | private String username; 20 | private String password; 21 | @Nullable 22 | private String nonProxyHosts; 23 | } 24 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/task/AzureTaskManagerProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for 4 | * license information. 5 | */ 6 | 7 | package com.microsoft.azure.toolkit.lib.common.task; 8 | 9 | import javax.annotation.Nonnull; 10 | 11 | @FunctionalInterface 12 | public interface AzureTaskManagerProvider { 13 | @Nonnull 14 | AzureTaskManager getTaskManager(); 15 | } 16 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/task/ICommittable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for 4 | * license information. 5 | */ 6 | 7 | package com.microsoft.azure.toolkit.lib.common.task; 8 | 9 | public interface ICommittable { 10 | T commit(); 11 | } 12 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/telemetry/AzureTelemetryConfigProvider.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.common.telemetry; 7 | 8 | import java.util.Map; 9 | 10 | public interface AzureTelemetryConfigProvider { 11 | public Map getCommonProperties(); 12 | 13 | public String getEventNamePrefix(); 14 | } 15 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/utils/Debouncer.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.common.utils; 7 | 8 | public interface Debouncer { 9 | void debounce(); 10 | 11 | void debounce(int delay); 12 | 13 | boolean isPending(); 14 | } 15 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/utils/ProcessEnvironmentProvider.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.common.utils; 7 | 8 | import java.util.Map; 9 | 10 | public interface ProcessEnvironmentProvider { 11 | public Map getEnvironment(); 12 | } 13 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/resource/message/ISenderReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * * Licensed under the MIT License. See License.txt in the project root for license information. 5 | * 6 | */ 7 | 8 | package com.microsoft.azure.toolkit.lib.resource.message; 9 | 10 | import com.microsoft.azure.toolkit.lib.common.model.AzResource; 11 | 12 | public interface ISenderReceiver extends AzResource { 13 | public void startReceivingMessage(); 14 | public void stopReceivingMessage(); 15 | public void sendMessage(String message); 16 | public boolean isListening(); 17 | public boolean isSendEnabled(); 18 | } 19 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.resource.AzureResources 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/resources/schema/com/microsoft/azure/toolkit/appservice/AppServiceName.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "App Service Name", 3 | "$schema": "http://json-schema.org/draft-07/schema#", 4 | "description": "Name for Azure App Service", 5 | "type": "string", 6 | "pattern": "^[a-zA-Z0-9\\-]+$", 7 | "minLength": 2, 8 | "maxLength": 60 9 | } 10 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/resources/schema/com/microsoft/azure/toolkit/appservice/AppServicePlanName.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "App Service Plan Name", 3 | "$schema": "http://json-schema.org/draft-07/schema#", 4 | "description": "Name for Azure App Service Plan", 5 | "type": "string", 6 | "pattern": "^[a-zA-Z0-9\\-]+$", 7 | "minLength": 1, 8 | "maxLength": 60 9 | } 10 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/resources/schema/com/microsoft/azure/toolkit/appservice/DeploymentSlotName.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "App Service Deployment Slot Name", 3 | "$schema": "http://json-schema.org/draft-07/schema#", 4 | "description": "Name for Azure App Service deployment slot", 5 | "type": "string", 6 | "pattern": "^[A-Za-z0-9-]+$", 7 | "minLength": 1, 8 | "maxLength": 60 9 | } 10 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/resources/schema/com/microsoft/azure/toolkit/appservice/Runtime.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Runtime", 3 | "$schema": "http://json-schema.org/draft-07/schema#", 4 | "description": "Runtime configuration for Maven plugin for App Service", 5 | "type": "object", 6 | "properties": { 7 | "os": { 8 | "$ref": "#/definitions/os" 9 | }, 10 | "webContainer": { 11 | "$ref": "classpath:///schema/common/NonEmptyString.json" 12 | }, 13 | "javaVersion": { 14 | "$ref": "classpath:///schema/common/NonEmptyString.json" 15 | }, 16 | "image": { 17 | "$ref": "classpath:///schema/common/NonEmptyString.json" 18 | }, 19 | "serverId": { 20 | "$ref": "classpath:///schema/common/NonEmptyString.json" 21 | }, 22 | "registryUrl": { 23 | "type": "string", 24 | "pattern": "^https.*" 25 | } 26 | }, 27 | "dependencies": { 28 | "serverId": [ 29 | "image" 30 | ], 31 | "registryUrl": [ 32 | "image" 33 | ] 34 | }, 35 | "definitions": { 36 | "os": { 37 | "description": "The operating system for app service", 38 | "type": "string", 39 | "pattern": "(?i)^(windows|linux|docker)$" 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/resources/schema/com/microsoft/azure/toolkit/common/AzureEnvironment.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Azure Environment", 3 | "$schema": "http://json-schema.org/draft-07/schema#", 4 | "description": "The Azure cloud environment", 5 | "type": "string", 6 | "default": "AZURE", 7 | "pattern": "(?i)^(AZURE|AZURE_CHINA|AZURE_GERMANY|AZURE_US_GOVERNMENT)$" 8 | } 9 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/resources/schema/com/microsoft/azure/toolkit/common/NonEmptyString.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "None Empty String", 3 | "$schema": "http://json-schema.org/draft-07/schema#", 4 | "description": "Schema for non-empty string", 5 | "type": "string", 6 | "minLength": 1 7 | } 8 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/resources/schema/com/microsoft/azure/toolkit/common/ResourceGroupName.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Azure Resource Group", 3 | "$schema": "http://json-schema.org/draft-07/schema#", 4 | "description": "Name for Azure Resource Group", 5 | "type": "string", 6 | "pattern": "^[a-zA-Z0-9\\.\\_\\-\\(\\)]+$", 7 | "minLength": 2, 8 | "maxLength": 90 9 | } 10 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-common-lib/src/main/resources/schema/com/microsoft/azure/toolkit/common/UUID.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "UUID", 3 | "$schema": "http://json-schema.org/draft-07/schema#", 4 | "description": "Universally Unique Identifier", 5 | "type": "string", 6 | "format": "uuid" 7 | } 8 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-compute-lib/src/main/java/com/microsoft/azure/toolkit/lib/compute/virtualmachine/model/AuthenticationType.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.compute.virtualmachine.model; 6 | 7 | public enum AuthenticationType { 8 | Password, 9 | SSH 10 | } 11 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-compute-lib/src/main/java/com/microsoft/azure/toolkit/lib/compute/virtualmachine/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.compute.virtualmachine.model; 7 | 8 | import org.apache.commons.lang3.StringUtils; 9 | 10 | import java.util.Arrays; 11 | 12 | public enum OperatingSystem { 13 | Windows, 14 | Linux; 15 | 16 | public static OperatingSystem fromString(String value) { 17 | return Arrays.stream(values()).filter(operatingSystem -> StringUtils.equalsIgnoreCase(operatingSystem.name(), value)) 18 | .findFirst().orElse(null); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-compute-lib/src/main/java/com/microsoft/azure/toolkit/lib/compute/virtualmachine/model/SpotConfig.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.compute.virtualmachine.model; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.Getter; 10 | 11 | @Getter 12 | @AllArgsConstructor 13 | public class SpotConfig { 14 | private final double maximumPrice; 15 | private final EvictionType type; 16 | private final EvictionPolicy policy; 17 | 18 | public enum EvictionType { 19 | CapacityOnly, 20 | PriceOrCapacity; 21 | } 22 | 23 | public enum EvictionPolicy { 24 | StopAndDeallocate, 25 | Delete; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-compute-lib/src/main/java/com/microsoft/azure/toolkit/lib/network/virtualnetwork/Subnet.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.network.virtualnetwork; 7 | 8 | import lombok.EqualsAndHashCode; 9 | import lombok.Getter; 10 | import lombok.RequiredArgsConstructor; 11 | 12 | @Getter 13 | @RequiredArgsConstructor 14 | @EqualsAndHashCode 15 | public class Subnet { 16 | private final String name; 17 | private final String addressSpace; 18 | 19 | public Subnet(com.azure.resourcemanager.network.models.Subnet resource) { 20 | this.name = resource.name(); 21 | this.addressSpace = resource.addressPrefix(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-compute-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.compute.AzureCompute 2 | com.microsoft.azure.toolkit.lib.network.AzureNetwork -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerapps-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerapps/config/ContainerAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.containerapps.config; 2 | 3 | import com.microsoft.azure.toolkit.lib.containerapps.containerapp.ContainerAppDraft; 4 | import com.microsoft.azure.toolkit.lib.containerapps.model.IngressConfig; 5 | import com.microsoft.azure.toolkit.lib.containerapps.model.ResourceConfiguration; 6 | import com.microsoft.azure.toolkit.lib.containerregistry.config.ContainerRegistryConfig; 7 | import lombok.Data; 8 | 9 | @Data 10 | public class ContainerAppConfig { 11 | private ContainerAppsEnvironmentConfig environment; 12 | private String appName; 13 | private IngressConfig ingressConfig; 14 | private ContainerRegistryConfig registryConfig; 15 | private ContainerAppDraft.ImageConfig imageConfig; 16 | private ResourceConfiguration resourceConfiguration; 17 | private ContainerAppDraft.ScaleConfig scaleConfig; 18 | } 19 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerapps-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerapps/config/ContainerAppsEnvironmentConfig.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.containerapps.config; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ContainerAppsEnvironmentConfig { 7 | private String subscriptionId; 8 | private String resourceGroup; 9 | private String appEnvironmentName; 10 | private String region; 11 | } 12 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerapps-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerapps/model/EnvironmentType.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.containerapps.model; 7 | 8 | public enum EnvironmentType { 9 | ConsumptionOnly, 10 | WorkloadProfiles 11 | } 12 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerapps-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.containerapps.AzureContainerApps 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerapps-lib/src/main/resources/template/aca/artifact-dockerfile: -------------------------------------------------------------------------------- 1 | ARG JAVA_VERSION=17 2 | FROM mcr.microsoft.com/openjdk/jdk:${JAVA_VERSION}-mariner 3 | WORKDIR /app 4 | COPY app.jar app.jar 5 | ENTRYPOINT ["java", "-jar", "app.jar"] 6 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerapps-lib/src/main/resources/template/aca/source-dockerfile: -------------------------------------------------------------------------------- 1 | ARG JAVA_VERSION=17 2 | 3 | # Step 1: Use microsoft JDK image with maven3 to build the application 4 | FROM mcr.microsoft.com/openjdk/jdk:${JAVA_VERSION}-mariner AS builder 5 | RUN tdnf install maven3 -y 6 | WORKDIR /app 7 | COPY pom.xml ./ 8 | COPY src ./src 9 | RUN mvn clean package -DskipTests 10 | 11 | # Step 2: Use microsoft JDK image for the final image 12 | FROM mcr.microsoft.com/openjdk/jdk:${JAVA_VERSION}-mariner 13 | WORKDIR /app 14 | COPY --from=builder /app/target/*.jar app.jar 15 | ENTRYPOINT ["java", "-jar", "app.jar"] 16 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerregistry-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerregistry/config/ContainerRegistryConfig.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.containerregistry.config; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ContainerRegistryConfig { 7 | private String subscriptionId; 8 | private String resourceGroup; 9 | private String registryName; 10 | private String region; 11 | private String sku; 12 | } 13 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerregistry-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerregistry/model/Sku.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.containerregistry.model; 7 | 8 | public enum Sku { 9 | Basic, 10 | Standard, 11 | Premium 12 | } 13 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerregistry-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.containerregistry.AzureContainerRegistry 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerservice/model/AgentPoolMode.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.containerservice.model; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.Getter; 11 | import org.apache.commons.lang3.StringUtils; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | @Getter 17 | @AllArgsConstructor 18 | @EqualsAndHashCode 19 | public class AgentPoolMode { 20 | public static final AgentPoolMode SYSTEM = new AgentPoolMode("System"); 21 | public static final AgentPoolMode USER = new AgentPoolMode("User"); 22 | 23 | private String value; 24 | 25 | public static List values() { 26 | return Arrays.asList(SYSTEM, USER); 27 | } 28 | 29 | public static AgentPoolMode fromString(String input) { 30 | return values().stream() 31 | .filter(logLevel -> StringUtils.equalsIgnoreCase(input, logLevel.getValue())) 32 | .findFirst().orElse(null); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerservice/model/IpFamily.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.containerservice.model; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.Getter; 11 | import org.apache.commons.lang3.StringUtils; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | @Getter 17 | @AllArgsConstructor 18 | @EqualsAndHashCode 19 | public class IpFamily { 20 | public static final IpFamily IPV4 = new IpFamily("IPv4"); 21 | public static final IpFamily IPV6 = new IpFamily("IPv6"); 22 | 23 | private String value; 24 | 25 | public static List values() { 26 | return Arrays.asList(IPV4, IPV6); 27 | } 28 | 29 | public static IpFamily fromString(String input) { 30 | return values().stream() 31 | .filter(logLevel -> StringUtils.equalsIgnoreCase(input, logLevel.getValue())) 32 | .findFirst().orElse(null); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerservice/model/NetworkMode.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.containerservice.model; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.Getter; 11 | import org.apache.commons.lang3.StringUtils; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | @Getter 17 | @AllArgsConstructor 18 | @EqualsAndHashCode 19 | public class NetworkMode { 20 | public static final NetworkMode TRANSPARENT = new NetworkMode("transparent"); 21 | public static final NetworkMode BRIDGE = new NetworkMode("bridge"); 22 | 23 | private String value; 24 | 25 | public static List values() { 26 | return Arrays.asList(TRANSPARENT, BRIDGE); 27 | } 28 | 29 | public static NetworkMode fromString(String input) { 30 | return values().stream() 31 | .filter(logLevel -> StringUtils.equalsIgnoreCase(input, logLevel.getValue())) 32 | .findFirst().orElse(null); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerservice/model/NetworkPlugin.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.containerservice.model; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.Getter; 11 | import org.apache.commons.lang3.StringUtils; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | @Getter 17 | @AllArgsConstructor 18 | @EqualsAndHashCode 19 | public class NetworkPlugin { 20 | public static final NetworkPlugin AZURE = new NetworkPlugin("azure"); 21 | public static final NetworkPlugin KUBENET = new NetworkPlugin("kubenet"); 22 | 23 | private String value; 24 | 25 | public static List values() { 26 | return Arrays.asList(AZURE, KUBENET); 27 | } 28 | 29 | public static NetworkPlugin fromString(String input) { 30 | return values().stream() 31 | .filter(logLevel -> StringUtils.equalsIgnoreCase(input, logLevel.getValue())) 32 | .findFirst().orElse(null); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerservice/model/NetworkPolicy.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.containerservice.model; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.Getter; 11 | import org.apache.commons.lang3.StringUtils; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | @Getter 17 | @AllArgsConstructor 18 | @EqualsAndHashCode 19 | public class NetworkPolicy { 20 | public static final NetworkPolicy CALICO = new NetworkPolicy("calico"); 21 | public static final NetworkPolicy AZURE = new NetworkPolicy("azure"); 22 | 23 | private String value; 24 | 25 | public static List values() { 26 | return Arrays.asList(CALICO, AZURE); 27 | } 28 | 29 | public static NetworkPolicy fromString(String input) { 30 | return values().stream() 31 | .filter(logLevel -> StringUtils.equalsIgnoreCase(input, logLevel.getValue())) 32 | .findFirst().orElse(null); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerservice/model/OsType.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.containerservice.model; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.Getter; 11 | import org.apache.commons.lang3.StringUtils; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | @Getter 17 | @AllArgsConstructor 18 | @EqualsAndHashCode 19 | public class OsType { 20 | public static final OsType LINUX = new OsType("Linux"); 21 | public static final OsType WINDOWS = new OsType("Windows"); 22 | 23 | private String value; 24 | 25 | public static List values() { 26 | return Arrays.asList(LINUX, WINDOWS); 27 | } 28 | 29 | public static OsType fromString(String input) { 30 | return values().stream() 31 | .filter(logLevel -> StringUtils.equalsIgnoreCase(input, logLevel.getValue())) 32 | .findFirst().orElse(null); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerservice-lib/src/main/java/com/microsoft/azure/toolkit/lib/containerservice/model/PowerState.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.containerservice.model; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.Getter; 11 | import org.apache.commons.lang3.StringUtils; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | @Getter 17 | @AllArgsConstructor 18 | @EqualsAndHashCode 19 | public class PowerState { 20 | public static final PowerState RUNNING = new PowerState("Running"); 21 | public static final PowerState STOPPED = new PowerState("Stopped"); 22 | 23 | private String value; 24 | 25 | public static List values() { 26 | return Arrays.asList(RUNNING, STOPPED); 27 | } 28 | 29 | public static PowerState fromString(String input) { 30 | return values().stream() 31 | .filter(logLevel -> StringUtils.equalsIgnoreCase(input, logLevel.getValue())) 32 | .findFirst().orElse(null); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-containerservice-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.containerservice.AzureContainerService -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-cosmos-lib/src/main/java/com/microsoft/azure/toolkit/lib/cosmos/ICosmosCollection.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.cosmos; 2 | 3 | import com.microsoft.azure.toolkit.lib.common.model.AzResource; 4 | 5 | public interface ICosmosCollection extends AzResource { 6 | } 7 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-cosmos-lib/src/main/java/com/microsoft/azure/toolkit/lib/cosmos/ICosmosDatabase.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.cosmos; 2 | 3 | import com.microsoft.azure.toolkit.lib.common.model.AzResource; 4 | 5 | import java.util.List; 6 | 7 | public interface ICosmosDatabase extends AzResource { 8 | List listCollection(); 9 | } 10 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-cosmos-lib/src/main/java/com/microsoft/azure/toolkit/lib/cosmos/ICosmosDatabaseDraft.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.cosmos; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.model.AzResource; 9 | import com.microsoft.azure.toolkit.lib.cosmos.model.DatabaseConfig; 10 | 11 | public interface ICosmosDatabaseDraft extends AzResource.Draft { 12 | void setConfig(DatabaseConfig config); 13 | } 14 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-cosmos-lib/src/main/java/com/microsoft/azure/toolkit/lib/cosmos/ICosmosDocumentContainer.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.cosmos; 6 | 7 | import com.fasterxml.jackson.databind.node.ObjectNode; 8 | import com.microsoft.azure.toolkit.lib.common.action.Action; 9 | import com.microsoft.azure.toolkit.lib.common.model.AzResource; 10 | 11 | import javax.annotation.Nonnull; 12 | 13 | public interface ICosmosDocumentContainer extends AzResource { 14 | public static final Action.Id> IMPORT_DOCUMENT = Action.Id.of("user/cosmos.import_document.container"); 15 | public static final Action.Id> CREATE_DOCUMENT = Action.Id.of("user/cosmos.create_document.container"); 16 | 17 | T importDocument(@Nonnull final ObjectNode node); 18 | } 19 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-cosmos-lib/src/main/java/com/microsoft/azure/toolkit/lib/cosmos/model/CosmosDBAccountConnectionString.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.cosmos.model; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | public interface CosmosDBAccountConnectionString { 6 | @Nullable String getHost(); 7 | 8 | @Nullable Integer getPort(); 9 | 10 | @Nullable String getUsername(); 11 | 12 | @Nullable String getPassword(); 13 | 14 | @Nullable String getConnectionString(); 15 | } 16 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-cosmos-lib/src/main/java/com/microsoft/azure/toolkit/lib/cosmos/model/DatabaseConfig.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.cosmos.model; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.utils.Utils; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | 12 | @Data 13 | @EqualsAndHashCode(callSuper = true) 14 | public class DatabaseConfig extends ThroughputConfig { 15 | private String name; 16 | 17 | public static DatabaseConfig getDefaultDatabaseConfig() { 18 | return getDefaultDatabaseConfig("database"); 19 | } 20 | 21 | public static DatabaseConfig getDefaultDatabaseConfig(final String prefix) { 22 | final DatabaseConfig result = new DatabaseConfig(); 23 | result.setName(String.format("%s%s", prefix, Utils.getTimestamp())); 24 | result.setMaxThroughput(4000); 25 | return result; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-cosmos-lib/src/main/java/com/microsoft/azure/toolkit/lib/cosmos/model/ThroughputConfig.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.cosmos.model; 7 | 8 | import com.azure.resourcemanager.cosmos.models.AutoscaleSettings; 9 | import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; 10 | import lombok.Data; 11 | import org.apache.commons.lang3.ObjectUtils; 12 | 13 | import java.util.Objects; 14 | 15 | @Data 16 | public class ThroughputConfig { 17 | private Integer throughput; 18 | private Integer maxThroughput; 19 | 20 | public CreateUpdateOptions toCreateUpdateOptions() { 21 | assert ObjectUtils.anyNull(throughput, maxThroughput); 22 | if (ObjectUtils.allNull(throughput, maxThroughput)) { 23 | return null; 24 | } 25 | final CreateUpdateOptions options = new CreateUpdateOptions(); 26 | return Objects.nonNull(throughput) ? options.withThroughput(throughput) : 27 | options.withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(maxThroughput)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-cosmos-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.cosmos.AzureCosmosService -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-database-lib/src/main/java/com/microsoft/azure/toolkit/lib/database/FirewallRuleConfig.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.database; 7 | 8 | import lombok.Builder; 9 | import lombok.Getter; 10 | 11 | import javax.annotation.Nonnull; 12 | 13 | @Getter 14 | @Builder 15 | public class FirewallRuleConfig { 16 | @Nonnull 17 | private String name; 18 | private String startIpAddress; 19 | private String endIpAddress; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-database-lib/src/main/java/com/microsoft/azure/toolkit/lib/database/entity/IDatabase.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.database.entity; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.model.AzResource; 9 | import com.microsoft.azure.toolkit.lib.database.JdbcUrl; 10 | 11 | import javax.annotation.Nonnull; 12 | import javax.annotation.Nullable; 13 | 14 | public interface IDatabase extends AzResource { 15 | @Nullable 16 | String getCollation(); 17 | 18 | @Nonnull 19 | IDatabaseServer getServer(); 20 | 21 | @Nonnull 22 | JdbcUrl getJdbcUrl(); 23 | } 24 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-eventhubs-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.eventhubs.AzureEventHubsNamespace 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-identity-lib/src/main/java/com/microsoft/azure/toolkit/lib/identities/ManagedIdentitySupport.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.identities; 2 | 3 | import com.microsoft.azure.toolkit.lib.identities.model.IdentityConfiguration; 4 | 5 | import javax.annotation.Nonnull; 6 | 7 | public interface ManagedIdentitySupport { 8 | IdentityConfiguration getIdentityConfiguration(); 9 | 10 | void updateIdentityConfiguration(@Nonnull final IdentityConfiguration configuration); 11 | } 12 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-identity-lib/src/main/java/com/microsoft/azure/toolkit/lib/identities/model/IdentityConfiguration.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.identities.model; 7 | 8 | import com.microsoft.azure.toolkit.lib.identities.Identity; 9 | import lombok.AllArgsConstructor; 10 | import lombok.Builder; 11 | import lombok.Data; 12 | import lombok.NoArgsConstructor; 13 | 14 | import java.util.List; 15 | 16 | @Data 17 | @Builder 18 | @NoArgsConstructor 19 | @AllArgsConstructor 20 | public class IdentityConfiguration { 21 | // system assigned identity 22 | private boolean enableSystemAssignedManagedIdentity; 23 | private String tenantId; 24 | private String principalId; 25 | // user assigned identities 26 | private List userAssignedManagedIdentities; 27 | } 28 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-identity-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.identities.AzureManagedIdentity 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-keyvault-lib/src/main/java/com/microsoft/azure/toolkit/lib/keyvault/Credential.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.keyvault; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.model.AzResource; 9 | 10 | import java.util.List; 11 | import java.util.Optional; 12 | 13 | public interface Credential extends AzResource { 14 | KeyVault getKeyVault(); 15 | 16 | CredentialVersion getCurrentVersion(); 17 | 18 | List listVersions(); 19 | default void enable() { 20 | Optional.ofNullable(getCurrentVersion()).ifPresent(CredentialVersion::enable); 21 | } 22 | 23 | default void disable() { 24 | Optional.ofNullable(getCurrentVersion()).ifPresent(CredentialVersion::enable); 25 | } 26 | 27 | default Boolean isEnabled() { 28 | return Optional.ofNullable(getCurrentVersion()).map(CredentialVersion::isEnabled).orElse(false); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-keyvault-lib/src/main/java/com/microsoft/azure/toolkit/lib/keyvault/CredentialVersion.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.keyvault; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.model.AzResource; 9 | 10 | import javax.annotation.Nonnull; 11 | 12 | public interface CredentialVersion extends AzResource { 13 | @Nonnull 14 | Credential getCredential(); 15 | 16 | default KeyVault getKeyVault() { 17 | return getCredential().getKeyVault(); 18 | } 19 | 20 | void enable(); 21 | 22 | void disable(); 23 | 24 | Boolean isEnabled(); 25 | 26 | String getShowCredentialCommand(); 27 | 28 | String getDownloadCredentialCommand(final String path); 29 | } 30 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-keyvault-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.keyvault.AzureKeyVault 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-monitor-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.monitor.AzureLogAnalyticsWorkspace 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-mysql-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.mysql.AzureMySql 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-mysql-single-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.mysql.single.AzureMySql 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-postgre-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.postgre.AzurePostgreSql 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-postgre-single-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.postgre.single.AzurePostgreSql 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-redis-lib/src/main/java/com/microsoft/azure/toolkit/redis/model/RedisConfig.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.redis.model; 7 | 8 | 9 | import com.microsoft.azure.toolkit.lib.common.model.Region; 10 | import com.microsoft.azure.toolkit.lib.common.model.Subscription; 11 | import com.microsoft.azure.toolkit.lib.resource.ResourceGroup; 12 | import lombok.AllArgsConstructor; 13 | import lombok.Data; 14 | import lombok.NoArgsConstructor; 15 | 16 | @Data 17 | @NoArgsConstructor 18 | @AllArgsConstructor 19 | public class RedisConfig { 20 | private String name; 21 | private String id; 22 | private ResourceGroup resourceGroup; 23 | private Subscription subscription; 24 | private Region region; 25 | private PricingTier pricingTier; 26 | private boolean enableNonSslPort; 27 | } 28 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-redis-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.redis.AzureRedis 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-servicebus-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.servicebus.AzureServiceBusNamespace 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-springcloud-lib/src/main/java/com/microsoft/azure/toolkit/lib/springcloud/model/SpringCloudDeploymentStatus.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.springcloud.model; 7 | 8 | import lombok.Getter; 9 | 10 | @Getter 11 | public enum SpringCloudDeploymentStatus { 12 | UNKNOWN("Unknown"), 13 | STOPPED("Stopped"), 14 | RUNNING("Running"), 15 | FAILED("Failed"), 16 | ALLOCATING("Allocating"), 17 | UPGRADING("Upgrading"), 18 | COMPILING("Compiling"); 19 | private final String label; 20 | 21 | SpringCloudDeploymentStatus(String label) { 22 | this.label = label; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return this.label; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-springcloud-lib/src/main/java/com/microsoft/azure/toolkit/lib/springcloud/model/SpringCloudPersistentDisk.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.springcloud.model; 7 | 8 | import lombok.Builder; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.Getter; 11 | 12 | import java.util.Objects; 13 | 14 | @Getter 15 | @Builder 16 | @EqualsAndHashCode 17 | public class SpringCloudPersistentDisk { 18 | private final Integer sizeInGB; 19 | private final Integer usedInGB; 20 | private final String mountPath; 21 | 22 | public String toString() { 23 | if (sizeInGB > 0) { 24 | String value = String.format("Path: %s, Size: %d GB", this.mountPath, this.sizeInGB); 25 | if (Objects.nonNull(usedInGB)) { 26 | value += String.format(", Used: %d GB", this.usedInGB); 27 | } 28 | return value; 29 | } else { 30 | return "---"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-springcloud-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.springcloud.AzureSpringCloud 2 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-sqlserver-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.sqlserver.AzureSqlServer -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-storage-lib/src/main/java/com/microsoft/azure/toolkit/lib/storage/IStorageAccount.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.toolkit.lib.storage; 2 | 3 | import com.microsoft.azure.toolkit.lib.common.model.AzResource; 4 | import com.microsoft.azure.toolkit.lib.storage.blob.BlobContainerModule; 5 | import com.microsoft.azure.toolkit.lib.storage.queue.QueueModule; 6 | import com.microsoft.azure.toolkit.lib.storage.share.ShareModule; 7 | import com.microsoft.azure.toolkit.lib.storage.table.TableModule; 8 | 9 | import javax.annotation.Nonnull; 10 | 11 | public interface IStorageAccount extends AzResource { 12 | @Nonnull 13 | String getConnectionString(); 14 | 15 | String getKey(); 16 | 17 | BlobContainerModule getBlobContainerModule(); 18 | 19 | ShareModule getShareModule(); 20 | 21 | TableModule getTableModule(); 22 | 23 | QueueModule getQueueModule(); 24 | } 25 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-storage-lib/src/main/java/com/microsoft/azure/toolkit/lib/storage/model/AccessTier.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.storage.model; 7 | 8 | public enum AccessTier { 9 | HOT("Hot"), 10 | COOL("Cool"); 11 | private final String value; 12 | 13 | AccessTier(String value) { 14 | this.value = value; 15 | } 16 | 17 | public String toString() { 18 | return this.value; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /azure-toolkit-libs/azure-toolkit-storage-lib/src/main/resources/META-INF/services/com.microsoft.azure.toolkit.lib.AzService: -------------------------------------------------------------------------------- 1 | com.microsoft.azure.toolkit.lib.storage.AzureStorageAccount -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/0-invalid-auth/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.mavenOpts = -Dsuffix=0 2 | invoker.buildResult = failure 3 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/1-no-runtime-setting/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.mavenOpts = -Dsuffix=1 2 | invoker.buildResult = failure 3 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/10-windows-jar/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-10", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/10-windows-jar/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-10", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/10-windows-jar/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/10-windows-jar/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/11-windows-war/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-11", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/11-windows-war/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-11", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/11-windows-war/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/11-windows-war/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/12-windows-auto-slot/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-12", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/12-windows-auto-slot/setup.groovy: -------------------------------------------------------------------------------- 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 | 7 | import com.microsoft.azure.maven.webapp.utils.TestUtils 8 | 9 | TestUtils.azureLogin() 10 | 11 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-12", true) 12 | 13 | TestUtils.createWebApp("maven-webapp-it-rg-12", "westus", 14 | "maven-webapp-it-rg-12-service-plan", "maven-webapp-it-rg-12-webapp", false) 15 | 16 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/12-windows-auto-slot/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/12-windows-auto-slot/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/13-linux-war-slot/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-13", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/13-linux-war-slot/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-13", true) 11 | 12 | TestUtils.createWebApp("maven-webapp-it-rg-13", "westus", 13 | "maven-webapp-it-rg-13-service-plan", "maven-webapp-it-rg-13-webapp-linux", true) 14 | 15 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/13-linux-war-slot/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/13-linux-war-slot/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/14-linux-zip/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-14", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/14-linux-zip/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-14", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/14-linux-zip/src/main/java/hello/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | import org.springframework.boot.*; 4 | import org.springframework.boot.autoconfigure.*; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | @RestController 8 | @EnableAutoConfiguration 9 | public class HelloWorld { 10 | 11 | @RequestMapping("/") 12 | String home() { 13 | return "Hello World!"; 14 | } 15 | 16 | public static void main(String[] args) throws Exception { 17 | SpringApplication.run(HelloWorld.class, args); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/15-v2-linux-zip/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-15", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/15-v2-linux-zip/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-15", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/15-v2-linux-zip/src/main/java/hello/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | import org.springframework.boot.*; 4 | import org.springframework.boot.autoconfigure.*; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | @RestController 8 | @EnableAutoConfiguration 9 | public class HelloWorld { 10 | 11 | @RequestMapping("/") 12 | String home() { 13 | return "Hello World!"; 14 | } 15 | 16 | public static void main(String[] args) throws Exception { 17 | SpringApplication.run(HelloWorld.class, args); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/16-v2-linux-war/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-16", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/16-v2-linux-war/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-16", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/16-v2-linux-war/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/16-v2-linux-war/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/17-v2-windows-ftp/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-17", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/17-v2-windows-ftp/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-17", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/17-v2-windows-ftp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/17-v2-windows-ftp/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/18-v2-private-registry/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-18", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/18-v2-private-registry/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-18", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/2-private-docker-hub/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-2", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/2-private-docker-hub/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-2", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/3-private-registry/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-3", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/3-private-registry/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-3", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/4-public-docker-hub/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-4", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/4-public-docker-hub/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-4", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/5-runtime-conflict/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.mavenOpts = -Dsuffix=5 2 | invoker.buildResult = failure 3 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/6-windows-ftp/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-6", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/6-windows-ftp/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-6", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/6-windows-ftp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/6-windows-ftp/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/7-linux-ftp/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-7", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/7-linux-ftp/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-7", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/7-linux-ftp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/7-linux-ftp/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/8-linux-jar-jre8/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-8", false) 9 | 10 | return true 11 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/8-linux-jar-jre8/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-8", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/8-linux-jar-jre8/src/main/java/hello/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | import org.springframework.boot.*; 4 | import org.springframework.boot.autoconfigure.*; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | @RestController 8 | @EnableAutoConfiguration 9 | public class HelloWorld { 10 | 11 | @RequestMapping("/") 12 | String home() { 13 | return "Hello World!"; 14 | } 15 | 16 | public static void main(String[] args) throws Exception { 17 | SpringApplication.run(HelloWorld.class, args); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/9-linux-war/cleanup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils; 7 | 8 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-9", false) 9 | 10 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/9-linux-war/setup.groovy: -------------------------------------------------------------------------------- 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 | import com.microsoft.azure.maven.webapp.utils.TestUtils 7 | 8 | TestUtils.azureLogin() 9 | 10 | TestUtils.deleteAzureResourceGroup("maven-webapp-it-rg-9", true) 11 | 12 | return true -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/9-linux-war/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/it/9-linux-war/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/main/java/com/microsoft/azure/maven/webapp/configuration/DeployTargetType.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.maven.webapp.configuration; 7 | 8 | public enum DeployTargetType { 9 | WEBAPP("Web App"), 10 | 11 | SLOT("Deployment Slot"); 12 | 13 | private final String value; 14 | 15 | DeployTargetType(String value) { 16 | this.value = value; 17 | } 18 | 19 | /* (non-Javadoc) 20 | * @see java.lang.Enum#toString() 21 | */ 22 | @Override 23 | public String toString() { 24 | return value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/main/java/com/microsoft/azure/maven/webapp/configuration/DeploymentSlotConfig.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.maven.webapp.configuration; 6 | 7 | import lombok.Builder; 8 | import lombok.Getter; 9 | 10 | import java.util.Map; 11 | 12 | @Getter 13 | @Builder 14 | public class DeploymentSlotConfig { 15 | private final String subscriptionId; 16 | private final String resourceGroup; 17 | private final String appName; 18 | private final String name; 19 | private final String configurationSource; 20 | private final Map appSettings; 21 | } 22 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/main/java/com/microsoft/azure/maven/webapp/configuration/SchemaVersion.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.maven.webapp.configuration; 7 | 8 | import com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException; 9 | 10 | import org.apache.commons.lang3.StringUtils; 11 | 12 | import java.util.Locale; 13 | 14 | public enum SchemaVersion { 15 | V1, 16 | V2; 17 | 18 | public static final String UNKNOWN_SCHEMA_VERSION = "Unknown value of in pom.xml."; 19 | 20 | public static SchemaVersion fromString(final String input) throws AzureExecutionException { 21 | final String schemaVersion = StringUtils.isEmpty(input) ? "v1" : input; 22 | 23 | switch (schemaVersion.toLowerCase(Locale.ENGLISH)) { 24 | case "v1": 25 | return V1; 26 | case "v2": 27 | return V2; 28 | default: 29 | throw new AzureExecutionException(UNKNOWN_SCHEMA_VERSION); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/main/resources/ApplicationInsights.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ${azure.ai.ikey} 5 | 6 | 7 | 8 | 9 | 10 | 1 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | project.version = ${project.version} 2 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/main/resources/web.config.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/test/resources/artifacthandlerv2/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /azure-webapp-maven-plugin/src/test/resources/pom-simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.ms.samples 5 | simple 6 | 0.0.1-SNAPSHOT 7 | jar 8 | 9 | simple 10 | http://maven.apache.org 11 | 12 | 13 | UTF-8 14 | 1.8 15 | 1.8 16 | 17 | 18 | 19 | 20 | junit 21 | junit 22 | 3.8.1 23 | test 24 | 25 | 26 | -------------------------------------------------------------------------------- /build-tools/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 4.0.0 7 | 8 | com.microsoft.azure 9 | azure-maven-plugins 10 | 1.42.0 11 | 12 | com.microsoft.azure 13 | maven-plugins-build-tools 14 | 1.42.0 15 | 16 | -------------------------------------------------------------------------------- /build-tools/src/main/resources/checkstyle/checkstyle-suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /build-tools/src/main/resources/checkstyle/java.header: -------------------------------------------------------------------------------- 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 | */ -------------------------------------------------------------------------------- /ci/appveyor.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | - develop 5 | 6 | environment: 7 | JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0" 8 | PYTHON: "C:\\Python35" 9 | dotnetcore_version: 2.1.302 10 | nodejs_version: "8" 11 | 12 | install: 13 | - cmd: npm i -g azure-functions-core-tools@core --unsafe-perm true 14 | - cmd: SET PATH=%PYTHON%;%PYTHON%\Scripts;%JAVA_HOME%\bin;%PATH% 15 | - cmd: copy "C:\Program Files (x86)\Apache\Maven\bin\mvn.cmd" "C:\Program Files (x86)\Apache\Maven\bin\mvn.bat" 16 | 17 | build_script: 18 | - cmd: mvnw.cmd -B clean install 19 | -------------------------------------------------------------------------------- /ci/appveyor_function.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | - develop 5 | 6 | environment: 7 | JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0" 8 | PYTHON: "C:\\Python38" 9 | dotnetcore_version: 2.1.302 10 | nodejs_version: "8" 11 | 12 | install: 13 | - cmd: SET PATH=%PYTHON%;%PYTHON%\Scripts;%JAVA_HOME%\bin;%PATH% 14 | - cmd: npm i -g azure-functions-core-tools@core --unsafe-perm true 15 | - cmd: python -m pip install azure-cli 16 | - cmd: copy "C:\Program Files (x86)\Apache\Maven\bin\mvn.cmd" "C:\Program Files (x86)\Apache\Maven\bin\mvn.bat" 17 | 18 | build_script: 19 | - cmd: mvn clean install && mvn -B -f azure-functions-maven-plugin/pom.xml clean verify -P it 20 | 21 | on_failure: 22 | - ps: | 23 | .\ci\ps\errorNotificationSender.ps1 "azure-functions-maven-plugin" 24 | 25 | -------------------------------------------------------------------------------- /ci/appveyor_function_e2e.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - develop 4 | 5 | environment: 6 | JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0" 7 | dotnetcore_version: 2.1.302 8 | nodejs_version: "8" 9 | 10 | install: 11 | - cmd: SET PATH=%PYTHON%;%PYTHON%\Scripts;%JAVA_HOME%\bin;%PATH% 12 | - cmd: copy "C:\Program Files (x86)\Apache\Maven\bin\mvn.cmd" "C:\Program Files (x86)\Apache\Maven\bin\mvn.bat" 13 | 14 | build_script: 15 | - ps: | 16 | $proc = .\ci\ps\e2etest.ps1 17 | 18 | test_script: 19 | - ps: | 20 | $response = curl http://localhost:7071/api/HttpExample?name=CI 21 | $success = $response.Content -eq "Hello, CI" 22 | if (-not $success) { exit 1 } 23 | 24 | on_finish: 25 | - ps: | 26 | Stop-Process -Id $proc.Id -Erroraction Ignore 27 | # Output standard input stream and error stream 28 | Write-Output "Standard input stream :" (gc ".\output.txt") 29 | Write-Output "Standard error stream :" (gc ".\error.txt") 30 | -------------------------------------------------------------------------------- /ci/appveyor_sdk_build_tool.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | - develop 5 | 6 | environment: 7 | JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0" 8 | PYTHON: "C:\\Python38" 9 | dotnetcore_version: 2.1.302 10 | nodejs_version: "8" 11 | 12 | install: 13 | - cmd: SET PATH=%PYTHON%;%PYTHON%\Scripts;%JAVA_HOME%\bin;%PATH% 14 | - cmd: npm i -g azure-functions-core-tools@core --unsafe-perm true 15 | - cmd: python -m pip install azure-cli 16 | - cmd: copy "C:\Program Files (x86)\Apache\Maven\bin\mvn.cmd" "C:\Program Files (x86)\Apache\Maven\bin\mvn.bat" 17 | 18 | build_script: 19 | - cmd: mvn clean install && mvn -B -f azure-sdk-build-tool-maven-plugin/pom.xml clean verify -P it 20 | 21 | on_failure: 22 | - ps: | 23 | .\ci\ps\errorNotificationSender.ps1 "azure-sdk-build-tool-maven-plugin" 24 | 25 | -------------------------------------------------------------------------------- /ci/appveyor_spring.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - feature-spring 4 | 5 | environment: 6 | matrix: 7 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 8 | JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0" 9 | 10 | - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu 11 | JAVA_HOME: "/usr/lib/jvm/java-8-openjdk-amd64" 12 | 13 | install: 14 | - cmd: SET PATH=%JAVA_HOME%\bin;%PATH% 15 | 16 | build_script: 17 | - cmd: mvnw -B clean verify && mvnw cobertura:cobertura 18 | - sh: | 19 | ./mvnw clean verify 20 | -------------------------------------------------------------------------------- /ci/appveyor_webapp.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | - develop 5 | 6 | environment: 7 | JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0" 8 | PYTHON: "C:\\Python38" 9 | 10 | install: 11 | - cmd: SET PATH=%PYTHON%;%PYTHON%\Scripts;%JAVA_HOME%\bin;%PATH% 12 | - cmd: python -m pip install azure-cli 13 | - cmd: copy "C:\Program Files (x86)\Apache\Maven\bin\mvn.cmd" "C:\Program Files (x86)\Apache\Maven\bin\mvn.bat" 14 | 15 | build_script: 16 | - cmd: mvn clean install && mvn -B -f azure-webapp-maven-plugin/pom.xml clean verify -P it 17 | 18 | on_failure: 19 | - ps: | 20 | .\ci\ps\errorNotificationSender.ps1 "azure-webapp-maven-plugin" 21 | -------------------------------------------------------------------------------- /docs/images/archtype-version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-maven-plugins/59024998ee1b8f0461b405b418339cc9d3b4874c/docs/images/archtype-version.png -------------------------------------------------------------------------------- /docs/images/azure-maven-plugins-version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-maven-plugins/59024998ee1b8f0461b405b418339cc9d3b4874c/docs/images/azure-maven-plugins-version.png -------------------------------------------------------------------------------- /docs/images/update-plugin-in-pom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-maven-plugins/59024998ee1b8f0461b405b418339cc9d3b4874c/docs/images/update-plugin-in-pom.png -------------------------------------------------------------------------------- /docs/web-config.md: -------------------------------------------------------------------------------- 1 | ## About web.config file 2 | 3 | > Note: This document will talk about web.config file when the user is using JAR deployment for a Windows Web App. 4 | 5 | When the user is using JAR deployment for a Windows Web App, the plugin will generate a a `web.config` file, 6 | this file will be saved at `%HOME%\site\wwwroot\` of your Web App. 7 | 8 | Below is the default template of `web.config` which is used in the plugin: 9 | 10 | ```xml 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ``` 22 | --------------------------------------------------------------------------------