Unable to create and run a web job

Prathyusha Bowrampet 5 Reputation points
2025-05-19T12:07:41.0966667+00:00

I am unable to create and run a Java WebJob on Azure App Service, even after following all the steps outlined in this official blog post:

Getting Started with Java WebJobs on Azure App Service: https://techcommunity.microsoft.com/blog/appsonazureblog/getting-started-with-java-webjobs-on-azure-app-service/4397229

The WebJob is based on a simple "Hello World" Java application using Java 17. I created a .jar file and confirmed that the script runs correctly locally.

Followed all the steps mentioned in the above blog post.

I also set "kuduAgent.enabled": false as suggested in the blog, but the WebJob still does not execute properly on Azure. There is no output or error that helps identify the issue.

After failing to create a WebJob through the portal, I successfully added it using the Kudu console. (https://stackoverflow.com/questions/79357036/azure-linux-app-service-fail-to-create-webjob) Once the web app was restarted, the WebJob appeared as expected. However, it failed to run, and there are no visible errors—only a warning related to the Netty client.

I would appreciate support in identifying what's going wrong and what steps are needed to successfully run a basic Java WebJob on Azure App Service.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,888 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dasari Kamali 425 Reputation points Microsoft External Staff Moderator
    2025-05-22T10:13:38.99+00:00

    Hi @Prathyusha Bowrampet,

    I have successfully deployed the same sample Hello World Java application using Java 17 to a WebJob on Azure App Service (Linux).

    run.sh :

    java -jar javakamweb-1.0-SNAPSHOT.jar 
    

    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>org.example</groupId>
        <artifactId>javakamweb</artifactId>
        <version>1.0-SNAPSHOT</version>
        <properties>
            <maven.compiler.source>17</maven.compiler.source>
            <maven.compiler.target>17</maven.compiler.target>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.10.1</version>
                    <configuration>
                        <source>17</source>
                        <target>17</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.3.0</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <mainClass>org.example.Main</mainClass>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.4.1</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals><goal>shade</goal></goals>
                            <configuration>
                                <transformers>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                        <mainClass>org.example.Main</mainClass>
                                    </transformer>
                                </transformers>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>
    

    Output :

    The Webjob ran successfully as shown below,
    3

    Logs :

    1

    Kudu Console Output :2

    Here is my GitHub repository, which contains run.sh and javakamweb-1.0-SNAPSHOT.jar.

    If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.