I'm a total newbie to Azure WebApps and I need some help.
I've created an Azure WebApp with Linux OS, Java 8 and Tomcat 9. I'm trying to deploy Mura application that's running on Lucee.
Taking bits from this example Mura CMS on Azure WebApps which was done on Windows, I created a ROOT.war containing Mura's code and a WEB-INF folder containing a web.xml and lucee.jar.
I'm now trying to deploy the war file but it doesn't seem to be working.
I've FTP'ed the .war file to /home/site/wwwroot/webapps/ and the above source suggested magically the war file would be unpacked, not sure if this a Windows thing? That didn't happen.
I've tried many different options mentioned here Deploy files to App Service but nothing seems to be working.
I tried the following in BASH and got this error Couldn't read data from file "/home/site/wwwroot/webapps/ROOT.war" probably because in BASH that path doesn't exist.
curl -X POST -u <username> --data-binary @"/home/site/wwwroot/webapps/ROOT.war" https://<appname>.scm.azurewebsites.net/api/publish&type=war
AND
curl -X POST -v -u <username> --data-binary @/home/site/wwwroot/webapps/ROOT.war https://<appname>.scm.azurewebsites.net/api/wardeploy
Another option was to do it via Powershell retuning a similar error as above Could not find a part of the path '/home/site/wwwroot/webapps/ROOT.war'.
Publish-AzWebapp -ResourceGroupName <groupName> -Name <appname> -ArchivePath /home/site/wwwroot/webapps/ROOT.war
Another example I found it to deploy from a storage account. Running this creates a new file app.war with zero bytes to /home/site/wwwroot
curl -X POST -u <username> https://<app-name>.scm.azurewebsites.net/api/publish -d '{"packageUri": "https://<storageName>.blob.core.windows.net/blob-container/ROOT.war?sv=2021-10-01&sb&sig=slk22f3UrS823n4kSh8Skjpa7Naj4CG3"}'
I then FTP'd a basic project, with the WEB-INF folder as mentioned above and a simple index.cfm page but I get a 500 error Servlet.init() for servlet [CFMLServlet] threw exception
I'm not sure if this is supposed to work on Linux OS, Java 8 and Tomcat 9 setup or if I should give in and try it out on a Windows machine.
Any guidance would be greatly appreciated.
CodePudding user response:
Thank you @david-I Posting your suggestion as an answer to help other community members for similar issues.
"The problem with using a windows machine is, currently you're not able to mount storage to it hence why I'm exploring Linux as believe it is possible to achieve this. There is an option under setting>config>path mappings>New azure storage mount. That said, I just had a go at deploying this on a windows machine, took 10min and it worked"
For more information please refer this Azure Blog
CodePudding user response:
I was able to achieve this using the following command via SSH. This was one of the commands I posted in my original post however, it wasn't just the username I need to add as per documentation but I also needed to add the password. Hope this helps anyone who is stuck on this. You can find the username/password under Deployment Center under the FTPS Credentials tab or via Overview and download the Get Publish profile
curl -X POST -v -u "\<username>:<password>" --data-binary @/home/site/wwwroot/webapps/ROOT.war https://<appname>.scm.azurewebsites.net/api/wardeploy