1

I have a simple spring boot application with controller class having Rest API's. Now I want to deploy this Java Spring application into Azure Web Job and trigger manually.

In Microsoft documentation (https://learn.microsoft.com/en-us/azure/app-service/webjobs-create) the details of deploying application written in .NET and C# is provided but I could not find anything related to Java or Spring boot App deployment into Azure Web job.

Can anyone please let me know the steps to be followed for deploying Spring boot app into Azure Web Job or Attach any documentations for reference?

Thanks & Regards, Preethi H R

1 Answer 1

1

To execute the Java web jobs on Azure, I have followed the MSDOC.

  1. created a Java spring boot Project and compressed into zip file.

  2. Open Azure Portal, navigate to App Service page of your App Service web app and select Webjobs and add a new Webjob by providing required settings as specified below:

  3. On the WebJobs page, select Add.

  4. Fill the details in Add WebJob settings as specified in the table. enter image description here

  • File Upload: Upload Executable or script file which has been converted to zip file (Springboot_H2_database_CRUD.zip).

Create a manually triggered WebJob

  1. select WebJobs in Azure App service, create a new web job by selecting Type as Triggered in the settings and select Manual in Triggers.

enter image description here

  1. Select OK.

  2. To run the WebJob, click on the webjob name and select Run. enter image description here

Create a scheduled WebJob

  • A scheduled Webjob is also triggered. You can schedule the trigger to occur automatically on the schedule you specify.

enter image description here

  • Select OK and Run the newly created webjob.

enter image description here

  • Desired execution frequency can be configured for the web job.
Sign up to request clarification or add additional context in comments.

5 Comments

Hi Pravallika, Thank you for your detailed answer, It is helpful. I have tried to add batch file inside my project folder and tried to deploy the web job. But then I am getting the following errors in web job logs when I run the web job:
[11/21/2022 10:39:10 > c96804: INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project testProject: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:3.2.0 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0, aopalliance:aopalliance:jar:1.0, org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M2a, asm:asm:jar:3.3.1,
Modify the version of Maven resources plugin in pom.xml as shown in this DOC
Hi Pravallika, Even after adding the plugin as specified in the doc I am getting the following error
INFO] [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to central (repo.maven.apache.org/maven2):

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.