Class AbstractFunctionMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    AddMojo, DeployMojo, ListMojo, PackageMojo, RunMojo

    public abstract class AbstractFunctionMojo
    extends com.microsoft.azure.maven.appservice.AbstractAppServiceMojo
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.microsoft.azure.maven.AbstractAzureMojo

        com.microsoft.azure.maven.AbstractAzureMojo.DefaultUncaughtExceptionHandler, com.microsoft.azure.maven.AbstractAzureMojo.RunnableWithException
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected String appInsightsInstance
      Name of the application insight instance, must be in the same resource group with function app.
      protected String appInsightsKey
      Instrumentation key of the application insights instance
      private static String DISABLE_APP_INSIGHTS_KEY  
      protected boolean disableAppInsights
      Boolean flag to monitor the Function App with application insights
      protected String finalName  
      private static String FUNCTION_DEPLOY_TO_SLOT_KEY  
      private static String FUNCTION_IS_DOCKER_KEY  
      private static String FUNCTION_JAVA_VERSION_KEY  
      private static String FUNCTION_PRICING_KEY  
      private static String FUNCTION_REGION_KEY  
      private static String FUNCTION_RUNTIME_KEY  
      protected File outputDirectory  
      protected ConfigParser parser  
      protected String pricingTier
      Pricing for function app
      protected String region
      Region for function app Supported values: westus, westus2, eastus, eastus2, northcentralus, southcentralus, westcentralus, canadacentral, canadaeast, brazilsouth, northeurope, westeurope, uksouth, eastasia, southeastasia, japaneast, japanwest, australiaeast, australiasoutheast, centralindia, southindia ...
      protected com.microsoft.azure.toolkit.lib.legacy.function.configurations.RuntimeConfiguration runtime
      Runtime environment of function app
      protected boolean skip
      Boolean flag to skip the execution of maven plugin for azure functions
      protected static String TRIGGER_TYPE  
      • Fields inherited from class com.microsoft.azure.maven.appservice.AbstractAppServiceMojo

        appName, appServiceClient, appServicePlanName, appServicePlanResourceGroup, appSettings, deploymentSlotSetting, MAVEN_PLUGIN_POSTFIX, resourceGroup
      • Fields inherited from class com.microsoft.azure.maven.AbstractAzureMojo

        allowTelemetry, auth, authType, buildDirectory, failsOnError, INSTALLATION_ID_KEY, mavenResourcesFiltering, plugin, PLUGIN_NAME_KEY, PLUGIN_VERSION_KEY, project, session, SESSION_ID_KEY, settings, settingsDecrypter, SUBSCRIPTION_ID_KEY, SUBSCRIPTION_NOT_FOUND, SUBSCRIPTION_TEMPLATE, subscriptionId, telemetries, telemetryProxy, USING_AZURE_ENVIRONMENT
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String getAppInsightsInstance()  
      String getAppInsightsKey()  
      String getFinalName()  
      String getRegion()  
      com.microsoft.azure.toolkit.lib.legacy.function.configurations.RuntimeConfiguration getRuntimeConfiguration()  
      Map<String,​String> getTelemetryProperties()  
      boolean isDisableAppInsights()  
      protected boolean isSkipMojo()  
      protected void validateAppName()  
      • Methods inherited from class com.microsoft.azure.maven.appservice.AbstractAppServiceMojo

        getAppName, getAppServicePlanName, getAppServicePlanResourceGroup, getAppSettings, getDeploymentSlotSetting, getDeploymentStagingDirectoryPath, getResourceGroup, getResources, initAzureAppServiceClient, printCurrentSubscription
      • Methods inherited from class com.microsoft.azure.maven.AbstractAzureMojo

        afterMojoExecution, beforeMojoExecution, checkSubscription, doExecute, execute, executeWithTimeRecorder, getActualAuthType, getBuildDirectoryAbsolutePath, getInstallationId, getMavenResourcesFiltering, getPluginName, getPluginVersion, getProject, getSession, getSessionId, getSettings, getSubscriptionId, getTargetSubscriptionId, getTelemetries, getTelemetryProxy, getUserAgent, highlightDefaultValue, infoWithMultipleLines, initTelemetryProxy, isAllowTelemetry, isFailsOnError, loginAzure, loginAzure, onMojoError, onSkipped, printCredentialDescription, selectSubscription, selectSubscription, trackMojoFailure, updateTelemetryProperties
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
    • Field Detail

      • finalName

        @Parameter(defaultValue="${project.build.finalName}",
                   readonly=true,
                   required=true)
        protected String finalName
      • outputDirectory

        @Parameter(defaultValue="${project.build.outputDirectory}",
                   readonly=true,
                   required=true)
        protected File outputDirectory
      • pricingTier

        @Parameter(property="functions.pricingTier")
        protected String pricingTier
        Pricing for function app

        Supported values : CONSUMPTION, B1, B2, B3, S1, S2, S3, P1V2, P2V2, P3V2, P1V3, P2V3, P3V3, EP1, EP2, EP3

      • skip

        @Parameter(property="functions.skip",
                   defaultValue="false")
        protected boolean skip
        Boolean flag to skip the execution of maven plugin for azure functions
        Since:
        0.1.0
      • region

        @Parameter(property="functions.region")
        protected String region
        Region for function app Supported values: westus, westus2, eastus, eastus2, northcentralus, southcentralus, westcentralus, canadacentral, canadaeast, brazilsouth, northeurope, westeurope, uksouth, eastasia, southeastasia, japaneast, japanwest, australiaeast, australiasoutheast, centralindia, southindia ...
        Since:
        1.2.0
      • runtime

        @Parameter(property="functions.runtime")
        protected com.microsoft.azure.toolkit.lib.legacy.function.configurations.RuntimeConfiguration runtime
        Runtime environment of function app

        Properties for Windows/Linux function app

        • os: Operating system for the function App, default to be Windows.
        • javaVersion: Java runtime version the function App, supported values are `Java 8`, `Java 11` and `Java 17`, default to be `Java 8`.
         
         <runtime>
             <os>windows</os>
             <javaVersion>Java 8</javaVersion>
         </runtime>
         
         
        Properties for Docker function app
        • image: Name of the docker image to deploy.
        • registryUrl: Docker repository of the image, could be omitted for docker hub.
        • serverId: The authentication profile id in maven settings.xml. For private docker image, please set your username and password in maven settings.xml and refer it with `serverId` in runtime configuration.
         
         <runtime>
             <os>docker</os>
             <image>[hub-user/]repo-name[:tag]</image>
             <serverId></serverId>
             <registryUrl></registryUrl> <!- could be omitted for docker hub images -->
         </runtime>
         
         
        Since:
        1.4.0
      • appInsightsInstance

        @Parameter(property="functions.appInsightsInstance")
        protected String appInsightsInstance
        Name of the application insight instance, must be in the same resource group with function app. Will be skipped if `appInsightsKey` is specified
        Since:
        1.6.0
      • appInsightsKey

        @Parameter(property="functions.appInsightsKey")
        protected String appInsightsKey
        Instrumentation key of the application insights instance
        Since:
        1.6.0
      • disableAppInsights

        @Parameter(property="functions.disableAppInsights",
                   defaultValue="false")
        protected boolean disableAppInsights
        Boolean flag to monitor the Function App with application insights
        Since:
        1.6.0
    • Constructor Detail

      • AbstractFunctionMojo

        public AbstractFunctionMojo()
    • Method Detail

      • getRegion

        public String getRegion()
      • isSkipMojo

        protected boolean isSkipMojo()
        Overrides:
        isSkipMojo in class com.microsoft.azure.maven.AbstractAzureMojo
      • getFinalName

        public String getFinalName()
      • getAppInsightsInstance

        public String getAppInsightsInstance()
      • getAppInsightsKey

        public String getAppInsightsKey()
      • isDisableAppInsights

        public boolean isDisableAppInsights()
      • getRuntimeConfiguration

        public com.microsoft.azure.toolkit.lib.legacy.function.configurations.RuntimeConfiguration getRuntimeConfiguration()
      • validateAppName

        protected void validateAppName()
      • getTelemetryProperties

        public Map<String,​String> getTelemetryProperties()
        Overrides:
        getTelemetryProperties in class com.microsoft.azure.maven.AbstractAzureMojo