6
votes

Can I add a Worker Role to a standard MVC4 Website which I am deploying to Azure Websites? I haven't seen any documentation on how to add a worker role to these deployments.

I hope I don't have to rebuild my entire project as a cloud project, convert MVC4 Website to a Web Role and then Add a new worker role... Is this the case? If so, has anyone done this with any success? I have a very large website that I would hate to repackage into a new project.

2

2 Answers

5
votes

No, but that's not a problem. You can have the following setup:

  • MyApp.Web (ASP.NET MVC 4 Web Application) -> Deploy to Windows Azure Web Sites
  • MyApp.CloudService -> Deploy to myapp.cloudapp.net
    • MyApp.Worker (Worker Role)

You can keep using Windows Azure Web Sites for your ASP.NET MVC application and create a new Cloud Service with a Worker Role for your background jobs.

2
votes

Web Roles as well as Worker Roles are available on Windows Azure Cloud Services. Windows Azure Website do not have Worker Roles.

However, you can have Windows Azure Website talking to your Worker Roles via Bus Services.

I hope I don't have to rebuild my entire project as a cloud project ...

I do not know how your application looks like, but Web Roles are very similar to web applications, so maybe it would be worth investigating potential change from "standard" web application to Azure Web Role.

Azure Web Roles provide lots of advantages like roles scalability, code deployment management etc.

Update: Azure Websites now support SSL for custom domain, for more information check the ScottGu's link about the announcement.

Update: Azure Websites now support scaling too.

Also bear in mind that currently Azure Web Sites do not support SSL for custom domains which could be a blocker for your application move to the cloud.