There are various options for deploying Java applications on an App Service. The application can be deployed as a ZIP file or directly as a WAR file. There are different ways for each variant, for example with Azure CLI, FTP, PowerShell or via a REST interface.

My favorite variant is the upload via curl as a WAR file to the REST interface. Most of the other ways had problems, for example the folders were often on the wrong level via upload with CLI or installing PowerShell was too cumbersome. But there are still a few points to consider if you use curl with REST:

  • the username and password are from the FTP deployment profile
    • you can copy the FTP username from the overview page, but use the first part only and don’t forget the leading $
    • the username must be given in simple '
  • you can copy the URL from the overview page, but:
    • add .scm bevor .azurewebsites.net
    • add /api/wardeploy at the end
  • sometimes the upload is specified with -d, but it must be done as a binary file with --data-binary

The following command can then be executed:

curl -X POST -v -u '$appservice4war' --data-binary @Magnolia.war https://appservice4war.scm.azurewebsites.net/api/wardeploy

Depending on the file size, the upload may take a few minutes. In this example it took about 6 minutes for the 350MB upload to finish and a few additional minutes for copy and the unpacking process to finish.

After the upload, deployment logs were created on the Kudu page:

These also show the exact unpacking process of the WAR file:

The application can then be used afterwards: