Deploying the Play 2.3.X app to Windows Azure

I recently created a small web app using Play 2.3.4. It works fine locally, so now I want to run it on Windows Azure.

So far I have created a Java website using the Azure Application Gallery by following this tutorial http://azure.microsoft.com/en-us/documentation/articles/web-sites-java-get-started/ . The server I chose was Apache Tomcat 7. Next Steps is a tutorial, http://azure.microsoft.com/en-us/documentation/articles/web-sites-java-add-app/ which says, that I need to place the WAR file in the webapps folder. I followed the guide to package a Play app as a WAR file using the Play2War plugin. Then I added that the WAR file for d: \ home \ site \ wwwroot \ bin \ apache-tomcat-7.0.52 \ webapps via FTP.

However, when I go to the site, all I see is the default tomcat page.

First question :

Have I used the Play2War plugin correctly?

I changed plugins.sbt and build.sbt

plugins.sbt

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.4")

// web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.0.0")

addSbtPlugin("com.github.play2war" % "play2-war-plugin" % "1.3-beta2") 

      

build.sbt

import com.github.play2war.plugin._

name := """playtest4"""

version := "1.0-SNAPSHOT"

Play2WarPlugin.play2WarSettings

Play2WarKeys.servletVersion := "3.0"

lazy val root = (project in file(".")).enablePlugins(PlayJava)

scalaVersion := "2.11.1"

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache,
  javaWs
)

      

Then I installed sbt and ran the sbt war command. The play2war deployment page says that if I want to deploy my app as context root http://host:port/

, I need to rename the WAR app as ROOT.war for Tomcat 7, but that still didn't work.

Second question :

Is there an easier way to deploy my application to Azure?

Thank!

+3


source to share


1 answer


Please let me know the name of your azure site and I can research it. Make sure the ROOT folder in the directory: \ home \ site \ wwwroot \ bin \ apache-tomcat-7.0.52 \ webapps is removed before downloading the ROOT.war file. Also, as soon as you download the ROOT.war, tomcat should automatically deploy the war file and then extract its contents into the ROOT directory. But to be sure, restart your azure website and then click on your azure website.



0


source







All Articles