locked
Web roles and worker roles in Azure RRS feed

  • Question

  • Hi,

    I am developing a web service in java on Azure platform using Eclipse,but I am confused regarding use of web roles and worker roles.Can anyone please explain how do i decide about web and worker roles for java web service in Azure? Also, I have read about these roles for a .NET application is the same criteria followed for java as well?

    Friday, June 3, 2011 2:06 PM

Answers

  • Azure Role Startup Tasks exist to allow you to install dependencies for your apps that require additional permissions prior to your role starting.

    You can define a Startup Task in your ServiceDefinition.csdef file.

    <ServiceDefinition name="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
      <WebRole name="WebRole1">
       <Startup>
         <Task commandLine="Startup.cmd" executionContext="limited" taskType="simple">
         </Task>
       </Startup>
      </WebRole>
    </ServiceDefinition>
    
    For more information about Startup Tasks, check out http://msdn.microsoft.com/en-us/library/hh180155.aspx.

    More specifically for Java, here is a good blog post from Mario Kosmiskas title "Deploying Java Applications in Azure". It walks through the process of configuring your Azure service to run Jetty. http://blogs.msdn.com/b/mariok/archive/2011/01/05/deploying-java-applications-in-azure.aspx

    There are a number of examples of Apache Tomcat and other app servers, frameworks and runtimes running in Azure. If you have a specific need, let me know and I'll try to help you locate some guidance.

    Eric

     


    Eric D. Boyd - Director, Chicago + Cloud at Centare 
    Blog | twitter
    • Proposed as answer by Eric D. Boyd Friday, June 3, 2011 7:34 PM
    • Marked as answer by Abhilasha21 Saturday, June 4, 2011 3:54 AM
    Friday, June 3, 2011 7:33 PM

All replies

  • ASP.NET web applications make use of IIS (Microsoft's web server) for hosting and web roles come with IIS (Full or hosted web core) whereas worker role does not have IIS. If you are manually setting up some web server component using start up tasks or some other way, you could pretty much use worker role to host your java web service. Please have a look at this blog post for differences between web and worker roles.

     

    HTH.


    Please mark it as answer by clicking on "Propose As Answer", if it helps. My Blog : http://dotnetizen.blogspot.com
    Friday, June 3, 2011 2:22 PM
  • hi,

    Could you please explain what you mean by setting up some web server component using start up tasks or some other way?

    Friday, June 3, 2011 2:31 PM
  • I am not very much familiar with Java and the hosting platforms it uses. But I remember seeing some forum/blog posts about instantiating Tomcat or Apache server in Azure role instace for hosting Java web components.

    Here are some resources I could get with a quick search on web,

    http://archive.msdn.microsoft.com/winazuretomcat

    http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/9e7e134d-5818-42d3-968e-0299377419f9

     I am sure, you can find more such resources with better search criteria on any popular search engine.

    HTH.

     


    Please mark it as answer by clicking on "Propose As Answer", if it helps. My Blog : http://dotnetizen.blogspot.com
    Friday, June 3, 2011 2:47 PM
  • Azure Role Startup Tasks exist to allow you to install dependencies for your apps that require additional permissions prior to your role starting.

    You can define a Startup Task in your ServiceDefinition.csdef file.

    <ServiceDefinition name="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
      <WebRole name="WebRole1">
       <Startup>
         <Task commandLine="Startup.cmd" executionContext="limited" taskType="simple">
         </Task>
       </Startup>
      </WebRole>
    </ServiceDefinition>
    
    For more information about Startup Tasks, check out http://msdn.microsoft.com/en-us/library/hh180155.aspx.

    More specifically for Java, here is a good blog post from Mario Kosmiskas title "Deploying Java Applications in Azure". It walks through the process of configuring your Azure service to run Jetty. http://blogs.msdn.com/b/mariok/archive/2011/01/05/deploying-java-applications-in-azure.aspx

    There are a number of examples of Apache Tomcat and other app servers, frameworks and runtimes running in Azure. If you have a specific need, let me know and I'll try to help you locate some guidance.

    Eric

     


    Eric D. Boyd - Director, Chicago + Cloud at Centare 
    Blog | twitter
    • Proposed as answer by Eric D. Boyd Friday, June 3, 2011 7:34 PM
    • Marked as answer by Abhilasha21 Saturday, June 4, 2011 3:54 AM
    Friday, June 3, 2011 7:33 PM
  • Thanks a lot! This cleared my doubts about roles in azure.More specifically , I am using Tomcat ,so is there any link you could refer me that could me deploy my java aaplication?

    thanks again.

    Saturday, June 4, 2011 3:59 AM
  • David Chou has a couple of posts on using Java in Windows Azure that you might find interesting - here and here.
    Saturday, June 4, 2011 6:13 AM
    Answerer