Can websites published to Azure have worker roles?
Asked Answered
B

2

6

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.

Bedizen answered 4/1, 2013 at 23:39 Comment(0)
G
5

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.

Grenier answered 5/1, 2013 at 0:3 Comment(2)
Would the website communicate to the worker role through a service bus? Or does the worker role automatically expose a web endpoint?Neisa
@lividsquirrel You have all options. Service Bus, Database, Custom End Point (Worker Roles does not automatically expose a HTTP endpoint, but it's possible: code.msdn.microsoft.com/windowsazure/… ). But most likely... if a HTTP endpoint is what you need, an Azure WebSite or a Web Role would be the way. "Normally" a Worker Role would talk to the Website/Web Role and not the other way around.Goatskin
A
2

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.

Archiepiscopate answered 5/1, 2013 at 0:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.