Enabling Support for 32-bit IIS Applications in Windows Azure

Windows Azure web roles are hosted on IIS, which allows to enable 32-bit applications in the advanced settings. See one screenshot below.

image

The feature is turned off by default. To enable it in Windows Azure, all you have to do is to define a startup task in the service definition file as follows:

<Startup> <Task commandLine="ConfigureIIS.cmd" executionContext="elevated" taskType="simple" /> </Startup>

This startup task runs before your web role starts.

Check out Christian Weyer’s post below for more detail.

For this scenario you need to enable 32-bit support in (full) IIS in your web role. The following is a startup task script that enables 32-bit applications in IIS settings by using appcmd.exe .

enable32bit.cmd:

%windir%\system32\inetsrv\appcmd set config -section:applicationPools
-applicationPoolDefaults.enable32BitAppOnWin64:true

And this is the necessary startup task defined in the service definition file:

ServiceDefinition.csdef:

 <Startup>
   <Task commandLine="enable32bit.cmd" executionContext="elevated" taskType="simple" />
</Startup>

For more info on Windows Azure startup tasks, check the following resources:

Introduction to Windows Azure Startup Tasks

https://blog.smarx.com/posts/introduction-to-windows-azure-startup-tasks

How to Configure IIS Components in Windows Azure

https://msdn.microsoft.com/en-us/library/gg433059.aspx

Cloud Cover Episode 31 - Startup Tasks, Elevated Privileges, and Classic ASP

https://channel9.msdn.com/Shows/Cloud+Cover/Cloud-Cover-Episode-31-Startup-Tasks-Elevated-Privileges-and-Classic-ASP