Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying a War file to Azure [duplicate]

Tags:

java

tomcat

azure

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.

like image 1000
Potatosaurus Avatar asked Mar 24 '17 12:03

Potatosaurus


2 Answers

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.

  1. 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.

enter image description here

  1. 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.

enter image description here enter image description here

  1. A convenient and fast way is using Kudu tool to drag & drop your war file into the webapps directory, as below.

enter image description here

  1. 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.

like image 120
Peter Pan Avatar answered Sep 18 '22 02:09

Peter Pan


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.

like image 22
user3004449 Avatar answered Sep 17 '22 02:09

user3004449