Questions tagged [azure-web-roles]

A Microsoft Azure Web Role is a Windows Server Compatible Virtual Machine (VM) with IIS enabled, along with scaffolding code that provides a launch point for your own code to run within the VM.

Web Roles and Worker Roles form the basis of the Azure Cloud Services PaaS offering, removing the need for developers to manage the platform on which their applications will run.

The primary difference between a Web Role and Worker Role is the enabling of IIS. Both Web Roles and Worker Roles may run the same code, though it's often useful to split code between different roles for scaling purposes.

Within Visual Studio, you'll also see a slightly different role template, but the 4 primary events/overrides are available in both:

  • OnStart()
  • Run()
  • Stopping()
  • OnStop()

Further: If apps need to be installed (or registry changes are needed), and those tasks need elevated privileges, there's the ability to run startup tasks, which execute prior to OnStart().

In either roles you can choose the type of operating system running by modifying the service configuration file (.cscfg). Possible options are:

  • osFamily 1: equivalent of Windows Server 2008 SP2 x64
  • osFamily 2: equivalent of Windows Server 2008 R2
  • osFamily 3: equivalent of Windows Server 2012
  • osFamily 4: equivalent of Windows Server 2012 R2

You can read more about service configuration schema here.

1139 questions
9
votes
2 answers

How can I get the WebRole site root path from RoleEntryPoint.OnStart()?

As part of starting up a WebRole on Windows Azure I would like to access files on the website being started and I would like to do this in RoleEntryPoint.OnStart(). This will for instance enable me to influence ASP.NET config before the ASP.NET…
mawtex
  • 1,564
  • 1
  • 12
  • 21
9
votes
4 answers

Azure communication between Worker Role and Web Role

Hi I am building a Cloud Service which has (for the moment) one web and one worker role. My desired workflow would be: the browser calls a webApi controller on the web role, which sends a message to a queue (or service bus) which is then processed…
Mirko Lugano
  • 975
  • 1
  • 11
  • 26
9
votes
4 answers

How to disable RC4 cipher on Azure Web Roles

I have a web application that is hosted on Microsoft Azure Web-Role. How can I disable RC4 cipher?
Mahmoud Samy
  • 2,822
  • 7
  • 34
  • 78
9
votes
2 answers

Can Azure Cloud service use a sha256 certificate

We need to update our Azure Cloud service with a brand new cert. The one I have been given specifies sha256 as the signature hash algorithm. We previously had one with sha1. When I tried to update and package of the Azure deployment the error I get…
ozz
  • 5,098
  • 1
  • 50
  • 73
9
votes
2 answers

Unable to cast object of type System.Security.Claims.ClaimsPrincipal to type Microsoft.IdentityModel.Claims.IClaimsPrincipal

I am developing one MVC4 application which authenticate corp domain users using ADFS and i have written the code and i am getting the error like below, am i not getting claims ? System.InvalidCastException: Unable to cast object of type…
user3240560
  • 360
  • 1
  • 2
  • 18
9
votes
1 answer

Multiple site strategy on web role(s) and cloud service(s)

We have 3 public facing web applications which we are migrating to Azure. All sites use port 80. OPTIONS As far as I understand, there are three different options when using Web Roles: 1. All 3 sites hosted in ONE web role in a single cloud…
Dave New
  • 38,496
  • 59
  • 215
  • 394
9
votes
3 answers

Can't get azure web role to run locally using the emulator

I have a web role that I'm trying to run locally using the emulator. I have it working on another computer, but I cannot get it working on a different one, and have gone as far as to reformat it and start from scratch. When I launch the site from…
w.brian
  • 16,296
  • 14
  • 69
  • 118
9
votes
2 answers

Error with Azure service SSL in Development Fabric

I'm running into a problem with getting SSL to work in the Development Fabric. I'm running a clean install of Windows 8 Pro with Visual Studio 2012 Ultimate and the October 2012 Azure SDK for .NET. IIS8 is not installed, only IIS Express, which…
Lars Kemmann
  • 5,509
  • 3
  • 35
  • 67
9
votes
3 answers

Protection API Exceptions when scaling Azure Web Roles using ACS

I have been using Azure ACS against Windows Live and Google and its been running without any problems. Last night we scaled instances from 1 running instance to 3 and since then people have reported issues when accessing our site. We've traced this…
JoeGeeky
  • 3,746
  • 6
  • 36
  • 53
9
votes
1 answer

Using and Creating helper in Asp.net MVC4 Web Application

I am using the Asp.net mvc4 WebRole, and I found this is a Web Application , Not a Web Site. after reading this article, I knew how to add customer Helper function in Asp.MVC4. In Web Site Appliction I can add a cshtml file in app_code folder like…
Joe.wang
  • 11,537
  • 25
  • 103
  • 180
8
votes
2 answers

How to detect if ASP.NET site is running locally, in azure web role, or azure web site?

Note: This is different from the question of detecting running locally versus in an Azure role, which I understand has been answered already. I've got an APS.NET MVC app which I deploy to Azure. I'm running V2.5 of the Azure tooling. I'd like to be…
BenjiFB
  • 4,545
  • 10
  • 46
  • 53
8
votes
3 answers

Do you need 2 instances of Azure websites for SLA like Web Roles?

On cloud services web roles you must create at least 2 instances to get Azure's 99.95% SLA because when they do updates to the servers' OS etc, Azure will need to restart the machines (one at a time). This is well documented and you will be shouted…
BritishDeveloper
  • 13,219
  • 9
  • 52
  • 62
8
votes
1 answer

Azure role being queried (GET /) every 5 minutes from Microsoft IP address

In one of our Azure roles we have a log that is accumulating a lot of HTTP 404 errors as a result of regular HTTP requests (Get / ) coming from an IP address belonging to MS. Is this "traffic" part of the Azure role health monitoring? We don't…
user3019919
  • 101
  • 7
8
votes
2 answers

A network-releated or instance-specific error occurred while establishing a connection to SQL Server

I have a simple mvc web site (using the VS internet template) on azurewebsites talking to a SQL Azure database in the same data center. The database at this time is just to do the built-in SimpleMembership Provider. I have already switched from…
8
votes
1 answer

Deployment to cloud fails saying size of DiagnosticStore cannot be reduced?

I recently upgraded my azure storage libraries from 1.7 to 2.1 and since then I have not been able to deploy to my cloud service. I keep getting this deployment error. The size of local resources cannot be reduced. Affected local resource is…
Bitsian
  • 2,238
  • 5
  • 37
  • 72
1 2
3
75 76