I am trying to move a website I am hosting on a server with IIS over to an Azure web site. I'm using a COM object but I'm not sure if I can register this? I found some posts talking about uploading the dll and registering it on start up but the article seems to be missing. Is this possible?
Asked
Active
Viewed 3,231 times
2 Answers
6
I had this exact problem registering legacy COM Components on Azure. I documented my methodology here:
AspPDF and AspJPEG on Windows Azure
Igorek is correct, you will need to use a Web Role to achieve this. The solution above is based on a single Web Role with a startup script to run regsvr32 as a startup task.
To summarise, there are essentially two parts to achieving this. First create a batch file to run the regsvr32 command:
chcp 1252>NUL
regsvr32 /s .\library\my-com-class.dll
exit /b 0
Then define a startup task in your ServiceDefinition.csdef file:
<Startup>
<Task commandLine="mybatchfile.cmd" executionContext="elevated" taskType="simple" />
</Startup>
This will trigger the command file to run on deployment.
-
1Where in the Project structure do you put the cmd file? Can you expand answer a little? Thank you – Stephen Price May 20 '14 at 09:14
3
You cannot register a COM object within an Azure Website. You will need to upgrade to Web Roles in order to do this. Registration of com object can happen during the startup scripts then.

Igorek
- 15,716
- 3
- 54
- 92
-
How do you do this? I'm looking through the dashboard but don't see anything about Web Roles. – thecaptain0220 Apr 16 '13 at 14:52
-
2Web Roles are part of the Cloud Services. You will need to create a Cloud Service (WebROle) in visual studio, add the existing project under it, instrument startup script registration of your COM object and make sure nothing else needs to get fixed/altered. Also, expect that WebRoles will run with at least 2 servers, so state & session need to be compatible with this – Igorek Apr 16 '13 at 14:57