azure-maven-plugins: Failed to execute goal azure-functions-maven-plugin:1.5.0 Failed to run Azure Functions. Please checkout console output

Plugin name and version - azure-functions-maven-plugin:1.5.0

Plugin configuration in your pom.xml

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>hello</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Hello Spring Function on Azure</name>

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.2.7.RELEASE</version>
	<relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<maven.compiler.source>1.8</maven.compiler.source>
	<maven.compiler.target>1.8</maven.compiler.target>
	 <azure.functions.maven.plugin.version>1.5.0</azure.functions.maven.plugin.version> 
	<!-- customize those two properties. The functionAppName should be unique 
		across Azure -->
	<functionResourceGroup>my-spring-function-resource-group2</functionResourceGroup>
	<functionAppName>my-spring-function2</functionAppName>

	<functionAppRegion>westus</functionAppRegion>
	<stagingDirectory>${project.build.directory}/azure-functions/${functionAppName}</stagingDirectory>
	<start-class>com.example.HelloFunction</start-class>
	<spring.boot.wrapper.version>1.0.25.RELEASE</spring.boot.wrapper.version>
</properties>

<dependencies>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-function-adapter-azure</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-function-web</artifactId>
		<scope>provided</scope>
	</dependency>

	<!-- Test -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
</dependencies>

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-function-dependencies</artifactId>
			<version>3.0.6.RELEASE</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

<build>
	<pluginManagement>
		<plugins>
			<plugin>
				<groupId>com.microsoft.azure</groupId>
				<artifactId>azure-functions-maven-plugin</artifactId>
				<version>${azure.functions.maven.plugin.version}</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.1.0</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>3.1.2</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.1.0</version>
			</plugin>
		</plugins>
	</pluginManagement>

	<plugins>
		<plugin>
			<groupId>com.microsoft.azure</groupId>
			<artifactId>azure-functions-maven-plugin</artifactId>
			<configuration>
				<resourceGroup>${functionResourceGroup}</resourceGroup>
				<appName>${functionAppName}</appName>
				<region>${functionAppRegion}</region>
				<appSettings>
					<!-- Run Azure Function from package file by default -->
					<property>
						<name>WEBSITE_RUN_FROM_PACKAGE</name>
						<value>1</value>
					</property>
					<property>
						<name>FUNCTIONS_EXTENSION_VERSION</name>
						<value>~2</value>
					</property>
					<property>
						<name>FUNCTIONS_WORKER_RUNTIME</name>
						<value>java</value>
					</property>
				</appSettings>
			</configuration>
			<executions>
				<execution>
					<id>package-functions</id>
					<goals>
						<goal>package</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<artifactId>maven-resources-plugin</artifactId>
			<executions>
				<execution>
					<id>copy-resources</id>
					<phase>package</phase>
					<goals>
						<goal>copy-resources</goal>
					</goals>
					<configuration>
						<overwrite>true</overwrite>
						<outputDirectory>
							${project.build.directory}/azure-functions/${functionAppName}
						</outputDirectory>
						<resources>
							<resource>
								<directory>${project.basedir}/src/main/azure
								</directory>
								<includes>
									<include>**</include>
								</includes>
							</resource>
						</resources>
					</configuration>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-dependency-plugin</artifactId>
			<executions>
				<execution>
					<id>copy-dependencies</id>
					<phase>prepare-package</phase>
					<goals>
						<goal>copy-dependencies</goal>
					</goals>
					<configuration>
						<outputDirectory>${stagingDirectory}/lib</outputDirectory>
						<overWriteReleases>false</overWriteReleases>
						<overWriteSnapshots>false</overWriteSnapshots>
						<overWriteIfNewer>true</overWriteIfNewer>
						<includeScope>runtime</includeScope>
					</configuration>
				</execution>
			</executions>
		</plugin>
		<!--Remove obj folder generated by .NET SDK in maven clean -->
		<plugin>
			<artifactId>maven-clean-plugin</artifactId>
			<version>3.1.0</version>
			<configuration>
				<filesets>
					<fileset>
						<directory>obj</directory>
					</fileset>
				</filesets>
			</configuration>
		</plugin>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
			<dependencies>
				<dependency>
					<groupId>org.springframework.boot.experimental</groupId>
					<artifactId>spring-boot-thin-layout</artifactId>
					<version>${spring.boot.wrapper.version}</version>
				</dependency>
			</dependencies>
		</plugin>
	</plugins>
</build>

<repositories>
	<repository>
		<id>spring-snapshots</id>
		<name>Spring Snapshots</name>
		<url>https://repo.spring.io/libs-snapshot-local</url>
		<snapshots>
			<enabled>true</enabled>
		</snapshots>
		<releases>
			<enabled>false</enabled>
		</releases>
	</repository>
	<repository>
		<id>spring-milestones</id>
		<name>Spring Milestones</name>
		<url>https://repo.spring.io/libs-milestone-local</url>
		<snapshots>
			<enabled>false</enabled>
		</snapshots>
	</repository>
	<repository>
		<id>spring-releases</id>
		<name>Spring Releases</name>
		<url>https://repo.spring.io/release</url>
		<snapshots>
			<enabled>false</enabled>
		</snapshots>
	</repository>
</repositories>
<pluginRepositories>
	<pluginRepository>
		<id>spring-snapshots</id>
		<name>Spring Snapshots</name>
		<url>https://repo.spring.io/libs-snapshot-local</url>
		<snapshots>
			<enabled>true</enabled>
		</snapshots>
		<releases>
			<enabled>false</enabled>
		</releases>
	</pluginRepository>
	<pluginRepository>
		<id>spring-milestones</id>
		<name>Spring Milestones</name>
		<url>https://repo.spring.io/libs-milestone-local</url>
		<snapshots>
			<enabled>false</enabled>
		</snapshots>
	</pluginRepository>
	<pluginRepository>
		<id>spring-releases</id>
		<name>Spring Releases</name>
		<url>https://repo.spring.io/libs-release-local</url>
		<snapshots>
			<enabled>false</enabled>
		</snapshots>
	</pluginRepository>
</pluginRepositories>
</project>

Expected behavior - Run the Azure function

Actual behavior - Error as pasted below

[7/23/2020 5:45:04 AM] FUNCTIONS_WORKER_RUNTIME set to java. Skipping WorkerConfig for language:node [7/23/2020 5:45:04 AM] File ‘C:\Program Files\dotnet\dotnet.exe’ is not found, ‘dotnet’ invocation will rely on the PATH environment variable. [7/23/2020 5:45:04 AM] FUNCTIONS_WORKER_RUNTIME set to java. Skipping WorkerConfig for language:powershell [7/23/2020 5:45:04 AM] FUNCTIONS_WORKER_RUNTIME set to java. Skipping WorkerConfig for language:python [7/23/2020 5:45:04 AM] Starting worker process:C:\Program Files\Java\jdk1.8.0_231\bin\java -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -noverify -Djava.net.preferIPv4Stack=true -jar “C:\Users\shashankdi\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\java\azure-functions-java-worker.jar” --host 127.0.0.1 --port 53238 --workerId 3f4b9e51-1de9-4a34-b5d0-439f93ffdec5 --requestId 84e3bf71-9670-4618-a262-863b24a20e7c --grpcMaxMessageLength 2147483647 [7/23/2020 5:45:04 AM] C:\Program Files\Java\jdk1.8.0_231\bin\java process with Id=12820 started [7/23/2020 5:45:04 AM] [INFO] {Application.main}: Azure Functions Java Worker version [ 1.5.3] Value cannot be null. (Parameter ‘provider’) Application is shutting down… [7/23/2020 5:46:04 AM] Starting worker process failed [7/23/2020 5:46:04 AM] The operation has timed out. [7/23/2020 5:46:04 AM] Failed to start language worker process for runtime: (null). workerId:3f4b9e51-1de9-4a34-b5d0-439f93ffdec5 [7/23/2020 5:46:04 AM] Initialization cancellation requested by runtime. [7/23/2020 5:46:04 AM] Shutting down language worker channels for runtime:java [7/23/2020 5:46:04 AM] Stopping host… [7/23/2020 5:46:04 AM] Host shutdown completed. [DEBUG] Process exit value: 1 [ERROR] [ERROR] Failed to run Azure Functions. Please checkout console output. [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 04:05 min [INFO] Finished at: 2020-07-23T11:16:06+05:30 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.5.0:run (default-cli) on project hello: Failed to run Azure Functions. Please checkout console output. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.5.0:run (default-cli) on project hello: Failed to run Azure Functions. Please checkout console output. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to run Azure Functions. Please checkout console output. at com.microsoft.azure.maven.AbstractAzureMojo.handleException (AbstractAzureMojo.java:509) at com.microsoft.azure.maven.AbstractAzureMojo.execute (AbstractAzureMojo.java:443) at com.microsoft.azure.maven.function.AbstractFunctionMojo.execute (AbstractFunctionMojo.java:183) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: com.microsoft.azure.common.exceptions.AzureExecutionException: Failed to run Azure Functions. Please checkout console output. at com.microsoft.azure.common.function.handlers.CommandHandlerImpl.handleExitValue (CommandHandlerImpl.java:104) at com.microsoft.azure.common.function.handlers.CommandHandlerImpl.runCommandWithReturnCodeCheck (CommandHandlerImpl.java:34) at com.microsoft.azure.maven.function.RunMojo.runFunctions (RunMojo.java:92) at com.microsoft.azure.maven.function.RunMojo.doExecute (RunMojo.java:69) at com.microsoft.azure.maven.AbstractAzureMojo.execute (AbstractAzureMojo.java:438) at com.microsoft.azure.maven.function.AbstractFunctionMojo.execute (AbstractFunctionMojo.java:183) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Steps to reproduce the problem

I am running the example given in https://github.com/Azure-Samples/hello-spring-function-azure

  1. Downloaded the example
  2. Followed the steps in pre-requisite (jdk1.8, Install Node js and npm, Install az cli, Install azure core functions tool)
  3. Ran the steps given i. mvn clean test ii. mvn package iii. mvn azure-functions:run And got above errors.

Additional Info.

node --version v12.18.3

npm --version 6.14.6

npm search azure-functions-core-tools NAME | DESCRIPTION | AUTHOR | DATE | VERSION | KEYWORDS azure-functions-core-tool | Azure Functions… | =ahmelsayed… | 2020-06-23 | 2.7.2628 | s | | | | |

Full log with debug on is attached. azure-functions-run-full-debug-log.txt

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 29 (7 by maintainers)

Most upvoted comments

@shashanksdixit Thanks for your report, we are looking into this issue.