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
    • 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 17`.
         
         <runtime>
             <os>windows</os>
             <javaVersion>Java 17</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
      • enableDistributedTracing

        @Parameter(property="functions.enableDistributedTracing")
        protected Boolean enableDistributedTracing
        Boolean flag to control whether to enable distributed tracing for function app
      • 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
      • alwaysReadyInstances

        @Parameter
        protected Integer alwaysReadyInstances
      • instanceSize

        @Parameter
        protected Integer instanceSize
      • maximumInstances

        @Parameter
        protected Integer maximumInstances
      • storageAccountName

        @Parameter
        protected String storageAccountName
        Name of the storage account. It will be created if it doesn't exist.
      • storageAccountResourceGroup

        @Parameter
        protected String storageAccountResourceGroup
        Resource group of storage account. It will be created if it doesn't exist.
      • environment

        @Parameter
        protected String environment
        Name of the container app environment. It will be created if it doesn't exist.
      • minReplicas

        @Parameter
        protected Integer minReplicas
        The minimum number of replicas when create function app on container app.
      • maxReplicas

        @Parameter
        protected Integer maxReplicas
        The maximum number of replicas when create function app on container app.
    • 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