@Mojo(name="deploy",
defaultPhase=DEPLOY)
public class DeployMojo
extends AbstractFunctionMojo
AbstractAzureMojo.DefaultUncaughtExceptionHandler, AbstractAzureMojo.RunnableWithExceptionappInsightsInstance, appInsightsKey, disableAppInsights, finalName, outputDirectory, pricingTier, region, runtime, skipappName, appServicePlanName, appServicePlanResourceGroup, appSettings, deploymentSlotSetting, deploymentType, MAVEN_PLUGIN_POSTFIX, PORTAL_URL_PATTERN, resourceGroupallowTelemetry, auth, authentication, authType, buildDirectory, DEPLOY, failsOnError, httpProxyHost, httpProxyPort, INSTALLATION_ID_KEY, mavenResourcesFiltering, plugin, PLUGIN_NAME_KEY, PLUGIN_VERSION_KEY, project, session, SESSION_ID_KEY, settings, settingsDecrypter, SUBSCRIPTION_ID_KEY, subscriptionId| Constructor and Description |
|---|
DeployMojo() |
| Modifier and Type | Method and Description |
|---|---|
private void |
bindApplicationInsights(Map appSettings,
boolean isCreation)
Binding Function App with Application Insights
Will follow the below sequence appInsightsKey -> appInsightsInstance -> Create New AI Instance (Function creation only)
|
protected void |
checkArtifactCompileVersion() |
protected void |
configureAppSettings(java.util.function.Consumer<Map> withAppSettings,
Map appSettings) |
private com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponent |
createApplicationInsights(ApplicationInsightsManager applicationInsightsManager,
String name) |
protected com.microsoft.azure.management.appservice.FunctionDeploymentSlot |
createDeploymentSlot(com.microsoft.azure.management.appservice.FunctionApp functionApp,
FunctionRuntimeHandler runtimeHandler) |
protected com.microsoft.azure.management.appservice.FunctionApp |
createFunctionApp(FunctionRuntimeHandler runtimeHandler) |
protected com.microsoft.azure.management.appservice.WebAppBase |
createOrUpdateResource() |
private void |
deployArtifact(DeployTarget deployTarget) |
protected void |
doExecute() |
private com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponent |
getApplicationInsights(ApplicationInsightsManager applicationInsightsManager,
String appInsightsInstance) |
protected ArtifactHandler |
getArtifactHandler() |
private File |
getArtifactToDeploy() |
DeploymentType |
getDeploymentType() |
protected DeploymentType |
getDeploymentTypeByRuntime() |
protected FunctionRuntimeHandler |
getFunctionRuntimeHandler() |
private com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponent |
getOrCreateApplicationInsights(boolean enableCreation) |
protected OperatingSystemEnum |
getOsEnum() |
protected boolean |
isDedicatedPricingTier() |
private boolean |
isDeployToSlot() |
private List<FunctionResource> |
listFunctions()
Sync triggers and return function list of deployed function app
Will retry when get empty result, the max retry times is LIST_TRIGGERS_MAX_RETRY
|
protected void |
listHTTPTriggerUrls()
List anonymous HTTP Triggers url after deployment
|
protected void |
parseConfiguration() |
protected com.microsoft.azure.management.appservice.FunctionDeploymentSlot |
updateDeploymentSlot(com.microsoft.azure.management.appservice.FunctionDeploymentSlot deploymentSlot,
FunctionRuntimeHandler runtimeHandler) |
protected com.microsoft.azure.management.appservice.FunctionApp |
updateFunctionApp(com.microsoft.azure.management.appservice.FunctionApp app,
FunctionRuntimeHandler runtimeHandler) |
private com.microsoft.azure.management.appservice.WebAppBase.Update |
updateFunctionAppSettings(com.microsoft.azure.management.appservice.WebAppBase.Update update) |
private void |
validateApplicationInsightsConfiguration() |
getAppInsightsInstance, getAppInsightsKey, getAppSettingsWithDefaultValue, getFinalName, getFunctionApp, getFunctionExtensionVersion, getPricingTier, getRegion, getRuntime, getTelemetryProperties, isDisableAppInsights, isSkipMojogetAppName, getAppServicePlanName, getAppServicePlanResourceGroup, getAppSettings, getDeploymentSlotSetting, getDeploymentStagingDirectoryPath, getResourceGroup, getResourcePortalUrl, getResources, setDeploymentSlotexecute, executeWithTimeRecorder, getAuthenticationSetting, getAuthMethod, getAuthTypeEnum, getAzureClient, getAzureClientByAuthType, getAzureTokenWrapper, getBuildDirectoryAbsolutePath, getHttpProxyHost, getHttpProxyPort, getInstallationId, getMavenResourcesFiltering, getPluginName, getPluginVersion, getProject, getSession, getSessionId, getSettings, getSubscriptionId, getTelemetryProxy, getUserAgent, handleException, infoWithMultipleLines, initAuth, initializeAuthConfiguration, initTelemetry, isAuthConfigurationExist, isFailingOnError, isTelemetryAllowed, printCurrentSubscription, trackMojoFailure, trackMojoSkip, trackMojoStart, trackMojoSuccessprivate static final int LIST_TRIGGERS_MAX_RETRY
private static final int LIST_TRIGGERS_RETRY_PERIOD_IN_SECONDS
private static final String DEPLOY_START
private static final String DEPLOY_FINISH
private static final String FUNCTION_APP_CREATE_START
private static final String FUNCTION_APP_CREATED
private static final String FUNCTION_SLOT_CREATE_START
private static final String FUNCTION_SLOT_CREATED
private static final String FUNCTION_APP_UPDATE
private static final String FUNCTION_APP_UPDATE_DONE
private static final String FUNCTION_SLOT_UPDATE
private static final String FUNCTION_SLOT_UPDATE_DONE
private static final String DEPLOYMENT_TYPE_KEY
private static final String UNKNOWN_DEPLOYMENT_TYPE
private static final String APPINSIGHTS_INSTRUMENTATION_KEY
private static final String APPLICATION_INSIGHTS_NOT_SUPPORTED
private static final String APPLICATION_INSIGHTS_CONFIGURATION_CONFLICT
private static final String FAILED_TO_GET_APPLICATION_INSIGHTS
private static final String SKIP_CREATING_APPLICATION_INSIGHTS
private static final String APPLICATION_INSIGHTS_CREATE_START
private static final String APPLICATION_INSIGHTS_CREATED
private static final String APPLICATION_INSIGHTS_CREATE_FAILED
private static final String INSTRUMENTATION_KEY_IS_NOT_VALID
private static final String FAILED_TO_GET_FUNCTION_APP_PRICING_TIER
private static final String FAILED_TO_LIST_TRIGGERS
private static final String UNABLE_TO_LIST_NONE_ANONYMOUS_HTTP_TRIGGERS
private static final String HTTP_TRIGGER_URLS
private static final String NO_ANONYMOUS_HTTP_TRIGGER
private static final String AUTH_LEVEL
private static final String HTTP_TRIGGER
private static final String NO_TRIGGERS_FOUNDED
private static final String SYNCING_TRIGGERS_AND_FETCH_FUNCTION_INFORMATION
private static final String ARTIFACT_INCOMPATIBLE
private static final String FUNCTION_APP_NOT_EXISTS
private com.microsoft.azure.management.appservice.JavaVersion parsedJavaVersion
public DeploymentType getDeploymentType() throws AzureExecutionException
getDeploymentType in class AbstractAppServiceMojoAzureExecutionExceptionprotected void doExecute()
throws AzureExecutionException
doExecute in class AbstractAzureMojoAzureExecutionExceptionprivate void deployArtifact(DeployTarget deployTarget) throws AzureExecutionException, AzureAuthFailureException
protected com.microsoft.azure.management.appservice.WebAppBase createOrUpdateResource()
throws AzureExecutionException,
AzureAuthFailureException
protected com.microsoft.azure.management.appservice.FunctionApp createFunctionApp(FunctionRuntimeHandler runtimeHandler) throws AzureAuthFailureException, AzureExecutionException
protected com.microsoft.azure.management.appservice.FunctionApp updateFunctionApp(com.microsoft.azure.management.appservice.FunctionApp app,
FunctionRuntimeHandler runtimeHandler)
throws AzureAuthFailureException,
AzureExecutionException
protected com.microsoft.azure.management.appservice.FunctionDeploymentSlot createDeploymentSlot(com.microsoft.azure.management.appservice.FunctionApp functionApp,
FunctionRuntimeHandler runtimeHandler)
throws AzureExecutionException,
AzureAuthFailureException
protected com.microsoft.azure.management.appservice.FunctionDeploymentSlot updateDeploymentSlot(com.microsoft.azure.management.appservice.FunctionDeploymentSlot deploymentSlot,
FunctionRuntimeHandler runtimeHandler)
throws AzureAuthFailureException,
AzureExecutionException
protected void listHTTPTriggerUrls()
protected FunctionRuntimeHandler getFunctionRuntimeHandler() throws AzureAuthFailureException, AzureExecutionException
protected OperatingSystemEnum getOsEnum() throws AzureExecutionException
AzureExecutionExceptionprotected ArtifactHandler getArtifactHandler() throws AzureExecutionException
AzureExecutionExceptionprotected DeploymentType getDeploymentTypeByRuntime() throws AzureExecutionException
AzureExecutionExceptionprotected boolean isDedicatedPricingTier()
throws AzureExecutionException
AzureExecutionExceptionprotected void checkArtifactCompileVersion()
throws AzureExecutionException
AzureExecutionExceptionprotected void parseConfiguration()
protected void configureAppSettings(java.util.function.Consumer<Map> withAppSettings, Map appSettings)
private com.microsoft.azure.management.appservice.WebAppBase.Update updateFunctionAppSettings(com.microsoft.azure.management.appservice.WebAppBase.Update update)
throws AzureExecutionException,
AzureAuthFailureException
private File getArtifactToDeploy() throws AzureExecutionException
AzureExecutionExceptionprivate List<FunctionResource> listFunctions() throws AzureExecutionException, AzureAuthFailureException, InterruptedException
AzureExecutionException - Throw if get empty result after LIST_TRIGGERS_MAX_RETRY times retryAzureAuthFailureException - Throw if meet Authentication exception while getting Azure client or Function appInterruptedException - Throw when thread was interrupted while sleeping between retryprivate void bindApplicationInsights(Map appSettings, boolean isCreation) throws AzureExecutionException, AzureAuthFailureException
appSettings - App settings mapisCreation - Define the stage of function app, as we only create ai instance by default when create new function appsAzureExecutionException - When there are conflicts in configuration or meet errors while finding/creating application insights instanceAzureAuthFailureExceptionprivate void validateApplicationInsightsConfiguration()
throws AzureExecutionException
AzureExecutionExceptionprivate boolean isDeployToSlot()
private com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponent getOrCreateApplicationInsights(boolean enableCreation)
throws AzureAuthFailureException
AzureAuthFailureExceptionprivate com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponent getApplicationInsights(ApplicationInsightsManager applicationInsightsManager, String appInsightsInstance)
private com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponent createApplicationInsights(ApplicationInsightsManager applicationInsightsManager, String name)
Copyright © 2021. All rights reserved.