Java – azure integration


Published on

Tutorial for integrating Windows Azure Platform and Java Web

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Java – azure integration

  2. 2. Azure’s Cloud Services Build infinitely scalable apps and services Support rich multi-tier architectures Automated application management (based on Meet WA Presentation by Scott Guthrie)
  3. 3. Windows Azure Subscription To deploy your application, you must have Azure’s subscription. Windows Azure offered 90-days trial for free. Azure’s Free Trial subscription granted you permission to every Azure’s services with limited quotas.
  4. 4. Registering for Free Trial You’ll need:  Email Address (Yahoo, Gmail, etc)  Phone Number  International Credit Card (VISA, Master Card) Visit us/pricing/free-trial/, then register your self You must NOT use your services exceeded your quota limit, or your account will be disabled
  5. 5. Preparing your Environment For JAVA Developer you must have these:  Eclipse (or any Eclipse-based IDE)  JDK 6  Server (Apache Tomcat 7 is recommended)  Windows Azure SDK  Windows Azure Plugin for Eclipse  Windows Azure Subscription Go to  Create your own Cloud Services
  6. 6. Preparing your Java Project Create a new Dynamic Web Project / Maven Web project Make sure that your project doesn’t have any ERRORS Export your project to .WAR file
  7. 7. Preparing your Azure Project Create a new Windows Azure Deployment project Set your project configuration:  Copy your exported .WAR file to “WorkerRole1/approot/”  package.xml, find: <component deploydir="%SERVER_APPS_LOCATION%" deploymethod="copy" importas=“{your-war- name}.war" type=""/>, edit with your .WAR file name
  8. 8. Preparing your Azure Project Continued:  Find startupApacheTomcat7.txt in “samples/” folder, copy all to clipboard  Find startup.cmd in “WorkerRole1/approot”. Open with text editor, block all text, paste it. Before you begin to the next step, you’ve to know Azure’s project structure
  9. 9. Azure Project’s Structure Cloud Services will use “WorkerRole”, it will have:  “util” folder. DO NOT EDIT  “run.cmd” DO NOT EDIT  “startup.cmd” (You can edit this like the instruction before this page)  “YourApplication.war”, your Java-web project  and (if you use Tomcat 7)
  10. 10. Azure Project’s Structure You can make startup.cmd download the zip by itself. It will greatly reduce the size of your project In startup.cmd:  Find script below:  ::cscript /NoLogo "utildownload.vbs" " 7/v7.0.26/bin/" "“  Remove the “::”
  11. 11. Azure Project’s Structure Continued:  That script will download for you automatically  For, you should add this code AFTER “download-tomcat” script  cscript /NoLogo "utildownload.vbs" "http://java-azure-" "“  Find this script:  SET WAR_NAME={YourWarName).war
  12. 12. Build and Upload Right-Click in your Azure project Choose Properties, find “Windows Azure”, change “Build For” to “Deployment to cloud” Click “Project” in Menu-Bar, click “Build Project” (to activate Azure Full Build) Refresh, and you’ll find “deploy” folder in your Azure Project Go to WindowsAzure Management Portal (
  13. 13. Build and Upload Click “Cloud Services” tab, I’m sure you have created one Click “CERTIFICATES”, upload your certificate (.pfx) that located in “AzureProject/cert”. Default password is: “Password1” It’s up to you, to choose “Staging” or “Production” Environment
  14. 14. Build and Upload Whether you choose Staging / Production Environment, the way you upload your project is the same In the bottom of the screen, click “UPLOAD”, find “.cspkg” and “.cscfg” in your “deploy” folder Waiting until you see the Status become: “RUNNING”
  15. 15. Troubleshooting Common problem is when you deploy your project  Status is always “RECYCLING”:  Maybe your web-project contains error. FIX IT  Maybe you didn’t use the right Project Structure. FIX IT (look from page 9-11)  Status is always “BUSY”:  Just wait for a while. If status become “RECYCLING”, see above.  If after you wait for so long, just delete the production. Upload it again
  16. 16. start now