Gradle Spring Boot Rest Service Application Deployment in Azure - java

I have been working on SpringBoot with Gradle tool. I am able to deploy the application locally. When I am trying to deploy using Microsoft Azure through GitHub the application got deployed. But I am not able to trigger the application services.
It means when I am trying to hit my REST service or Swagger page which is in application I am getting 404 error message on browser. I was able deploy the same using Heroku.
Note: I am new to Microsoft Azure. I have followed few Stack Overflow pages and Azure videos and Documents. But none of them were very helpful.

Per my experience, there are two ways for packaging a spring boot application, as an executable jar or a war file. I don't know which one is your choice.
If you packaged as an executable jar to deploy it on Azure WebApp, you need to create a web.xml file at the path wwwroot, and follow the document Upload a custom Java web app to Azure to configure it. The key configuration is for the attribute processPath with the value like java -jar <your spring boot executable jar file name>.jar.
If you packaged as a war file to deploy it on Azure WebApp, it's simple that you just need to refer to the document Add a Java application to Azure App Service Web Apps to upload the war file to the related directory webapps. However, if you didn't configure Azure WebApp with Java runtime, you also need to configure your Azure webapp instance on Azure portal or create a web.xml file to configure it as below.
Hope it helps.

Related

How to communicate cloud spring-boot with files which are available on azure?

We have a built a spring boot application which invokes a command-line eclipse tool and generates few output files. Configurations for eclipse tool is added in the application.properties file. This is successfully achieved locally. Now, we have deployed the spring-boot application to azure cloud and able to access the REST apis. But stuck while invoking the eclipse command-line tool. How to upload the commandline tool into azure and access it through the cloud app?

Unable to access restful webservices application deployed on tomcat8 in gcp compute engine

I have created a spring boot restful web services application and exported it to the WAR file. Created VM instance in GCP. Installed Java, tomcat, and MySQL. Created DB in MySql Server. Deployed the war file in /var/lib/tomcat8/webapps. The application seems working as tables are created in MySQL DB. I can access tomcat using ip:8080 but I cannot run my application. When I run an API from postman it says 403 forbidden (the same works from if run in spring boot). Am I missing any configuration? It will be greatly helpful if provided a solution.

Deploying a War file to Azure [duplicate]

This question already has an answer here:
Deploying WAR FILE in Microsoft Azure Web App
(1 answer)
Closed 5 years ago.
I am attempting to upload a War file of a web service to Azure, running tomcat 8.
I have the war file in the relevant webapps folder on onedrive, however the deployment consistently fails, and frustratingly it does so without an error message.
I'm pretty sure that if I can't use a method involving uploading the binary file to Azure, I cannot use Azure. When using repositories like github, the build would fail due to reference issues, so I believe that is not an option.
Unfortunately I must use Azure, I'm aware that with other services like AWS I'd be done in 5 minutes as you can directly upload without any Microsoft (tm) hassle.
Normally, there are 4 ways to deploy a war file on Azure Web Apps: FTP, repository like Github/BitBucket or OneDrive/Dropbox, Kudu Tool, Azure Toolkit for Eclipse/IntelliJ.
First of all, you need to know File structure on azure. The Java war file must be deployed at the directory webapps under the wwwroot path of Azure Web Apps. You can access the Kudu tool url https://<your-webapp-name>.scm.azurewebsites.net/DebugConsole to lookup it.
Using FTP for deployment, you can refer to the Kudu wiki page Accessing files via ftp to know it, and set the FTP user & password via Azure portal as below.
Using repository like GitHub, you can refer to the Kudu wiki page Deploying from GitHub to know it. Please first make sure the file structure on GitHub repository as the same as its under your wwwroot directory, as below.
A convenient and fast way is using Kudu tool to drag & drop your war file into the webapps directory, as below.
If you had installed Azure Toolkit for Eclipse/IntelliJ, you can refer to Deploy Java Web Apps to Azure using Eclipse or IntelliJ: Deploy Java Web Apps to Azure to do it.
Hope it helps. Any concern, please feel free to let me know.
Quick note that gave me a lot of frustration to figure out. If you use ftp via a client (I use FileZilla for it), think about this:
Place the .war file under: site > wwwroot > webapps > [Place .war file here].
Do also change the .war file name to: ROOT.war
It has to be that name for the system to deploy it. At least for me, the GitHub integration is not working, so I use this ftp method.
The deployment via ftp can take several minutes to be deployed and running.

Java Web Application Deployment

I am trying to deploy my java web application to Azure using FTP. Is the .war file enough to be uploaded? Or all the project files have to be uploaded?
I believe that .war file is enough, because in that file you have everything that your java web application need, like the java classes, servlets, static web pages, etc, as you can see in this example, opening the war file:
war file
In fact, when we use, for example, the Tomcat server, that's the only thing that the server use for running the web application.
I hope I have helped you!

Unable to publish web service which is created in java using eclipse

i am newbie to java/eclipse and also to creating web services.Now i am trying to host the web service which is created in java using eclipse.
http://www.softwareagility.gr/index.php?q=node/29
i am following the above link for my reference.
My problem is,i got struggle on after creating a web service.I have created a web service and run it through the tomcat server and its showing like the below image
this is the link of wsdl of my web service i got
"http://localhost:8080/ResourceA/services/Myservice?wsdl"
Now i need to know,what steps i want to do after these steps, to publish and run my web service through my cloud server?
Thanks in advance!..
Export the project as a Web Archive (.war file) and deploy that on the server.

Categories

Resources