Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

On the azure site they write about your application being run in a window server environment and that you should be able to run anything that you normally can on a window server.

So is it possible to install a windows service on azure?

share|improve this question

4 Answers 4

up vote 1 down vote accepted

Yet another update: You can absolutely install a Windows Service on an Azure compute instance, whether Web Role, Worker Role, or VM Role. There are startup tasks that let you execute elevated-privilege code in your Web / Worker Roles. I won't say it's exactly straightforward, but you can do it. For an example, check out this blog post.

Now: As @Adron states, there are better ways to go about managing your code in Windows Azure, which has similar event-handling in its OnStart(), Run(), Stopping(), and OnStop() overrides / events. You can migrate your existing service code to these methods. But... if you really need to stick with a direct port, leaving your code as-is, then yes, you can do it.

share|improve this answer

No, it is not possible to install a traditional Windows service on Azure. They are working on a VM kind of product you could use to do this, but it's not out yet AFAIK.

With Azure, you can deploy anything that you could a) xcopy over and b) run something from the command line to start. Sadly this means most traditional Windows software with installers, registry entries, services, etc. don't run out of the box.

What you probably want to do is take whatever payload is being run as a service and instead wrap it in the Azure runner. There's nothing stopping the code from running and binding to a port, it's just that you have to start it using the Azure mechanism instead of a Windows service.

share|improve this answer

Just to update this question.

It IS now indeed possible to run a windows service in Windows Azure using the VM Role.

However, a more ideal way to run a service in Windows Azure is to set it up as a Service Role and NOT as a Windows Service. Keep in mind the fact that you're dealing with the cloud and not the operating system, at least ideally. If you're needing to deal directly with the operating system then you may want to re-think the architecture & tooling that you're using.

share|improve this answer

It is also possible to install and run a Windows Service on a Web Role in Windows Azure. You can see an example in this post.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.