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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String getAppInsightsInstance()  
      String getAppInsightsKey()  
      protected File getArtifact()  
      protected com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionExtensionVersion getBundleVersion()  
      String getFinalName()  
      protected String getFunctionLibraryVersion()  
      protected File getHostJsonFile()  
      protected File getLocalSettingsJsonFile()  
      String getRegion()  
      com.microsoft.azure.toolkit.lib.legacy.function.configurations.RuntimeConfiguration getRuntimeConfiguration()  
      Map<String,​String> getTelemetryProperties()  
      boolean isDisableAppInsights()  
      protected boolean isSkipMojo()  
      protected com.fasterxml.jackson.databind.JsonNode readHostJson()  
      protected void validateAppName()  
      protected void validateFunctionCompatibility()  
      • 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, getAllowTelemetry, getBuildDirectoryAbsolutePath, getCompileLevel, getFailsOnError, getFailsOnRuntimeValidationError, getInstallationId, getMavenResourcesFiltering, getPluginName, getPluginVersion, getProject, getSession, getSessionId, getSettings, getSubscriptionId, getTargetSubscriptionId, getTelemetries, getTelemetryProxy, getUserAgent, getValidRuntimes, highlightDefaultValue, infoWithMultipleLines, initTelemetryProxy, loginAzure, loginAzure, onMojoError, onSkipped, printCredentialDescription, selectSubscription, selectSubscription, trackMojoFailure, updateTelemetryProperties, validateArtifactCompileVersion
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
    • Field Detail

      • FUNCTION_EXTENSION_LIBRARY_MAP

        protected static final Map<com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionExtensionVersion,​Set<Integer>> FUNCTION_EXTENSION_LIBRARY_MAP
      • 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
      • hostJson

        @Parameter(property="functions.hostJson",
                   defaultValue="host.json")
        protected String hostJson
        Path for host.json file
        Since:
        1.22.0
      • localSettingsJson

        @Parameter(property="functions.localSettingsJson",
                   defaultValue="local.settings.json")
        protected String localSettingsJson
        Path for local.settings.json file
        Since:
        1.22.0
      • artifactPath

        @Parameter(property="functions.artifact")
        protected String artifactPath
        Path for the artifact to package and deploy
    • 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()
      • getArtifact

        @Nonnull
        protected File getArtifact()
                            throws com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException
        Throws:
        com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException
      • getHostJsonFile

        protected File getHostJsonFile()
      • getLocalSettingsJsonFile

        protected File getLocalSettingsJsonFile()
      • validateAppName

        protected void validateAppName()
      • validateFunctionCompatibility

        protected void validateFunctionCompatibility()
      • getFunctionLibraryVersion

        @Nullable
        protected String getFunctionLibraryVersion()
      • readHostJson

        @Nullable
        protected com.fasterxml.jackson.databind.JsonNode readHostJson()
      • getBundleVersion

        @Nullable
        protected com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionExtensionVersion getBundleVersion()
      • getTelemetryProperties

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