Why the Windows Azure VM Role is not necessary (most of the time)

 

imageFor many people (including me till today) the windows azure instances are insufficient configurable. You have installed a naked Windows + IIS and .NET Framework. If you want to do anything else you have to use VM Role – that’s what you here. But in fact also the normal Windows Azure instances are much more versatile and most of the time you don’t need VM Role…

 

I need Ruby, Java, Node.js on Azure….

To say it short: Everything you are able to install on a regular Windows Server you are able to install on a regular Azure Instance.

Secret tip: preinstall Software

After the start of an instance you are able to govern a Code on it like for example on the RoleEntryPoint or the Startup CMD:

<ServiceDefinition name="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
   <WebRole name="WebRole1">
      <Startup>
         <Task commandLine="Startup.cmd" executionContext="limited" taskType="simple">
         </Task>
      </Startup>
   </WebRole>
</ServiceDefinition>

Because the Startup Task calls a simple CMD you can do almost everything on it. Steven Marx has created a cool website where he collects many interesting things about what you can do with Aure:

image

The Installscripts look a little bit … different but there are some nice examples like: how to install Phyton:

cd %~dp0
for /f %%p in ('GetLocalPath.exe Python') do set PYTHONPATH=%%p

msiexec /i python-2.7.1.msi /qn TARGETDIR="%PYTHONPATH%" /log installPython.log

%PYTHONPATH%\python -c "import sys, os; sys.path.insert(0, os.path.abspath('setuptools-0.6c11-py2.7.egg')); from setuptools.command.easy_install import bootstrap; sys.exit(bootstrap())"
%PYTHONPATH%\scripts\easy_install Pygments-1.4-py2.7.egg

echo y| cacls %PYTHONPATH% /t /grant everyone:f

exit /b 0

The trick is to deploy the installation Medias into the Azure Instance and to install it while starting the service like in this case of Node.js:

var proc = new Process()
{
    StartInfo = new ProcessStartInfo(
        RoleEnvironment.GetLocalResource("Executables").RootPath + @"\node.exe",
        string.Format("server.js {0}",
            RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["HttpIn"].IPEndpoint.Port))
    {
        UseShellExecute = false,
        WorkingDirectory = RoleEnvironment.GetLocalResource("Executables").RootPath
    }
};

Advantages of this method

At VM Role you have to take care about the update of your system software by yourself. Take a look on this Blogpost where you can read more about SLA, Statelessmess and Updating. In Fact I can’t promise to you if the examples on this side are Best Practices. It seems like it works and before you are too much into the VM thing it might be good to know your opportunities.

Disadvantages

Of course difficult installations takes there time… and they can fall through. If the Fabric Controller adjusts the VM it’s not good if it takes a long time to boot specific VMs – in this time you can’t use the needed resources.

Result

If you don’t use standard Azure components or install more Tools you can do it on several ways with the regular Windows Azure instance – but if the application is more complex (Sharepoint / TFS) it will be more difficult and maybe unsolvable. A view on these examples will show you more about this.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

About the author

Written by Code Inside Team

Learn more about our team.

One Response

  1. nice info…….

    Reply

Comment on this post

Recent Posts

  • Automated Security Analyser for ASP.NET websites

    Evil Hackers are lurking everywhere and many Web-applications are delicately and share “too much” with the attacker. A quick (first!) overview offers the Tool “ASafaWeb”. All the website does is making a few requests and writing an Analyses including problem solving’s. There are no permanent disadvantages (bad requests/ DoS attacks and so on). Example: KnowYourStack.com ...

  • image1489-570x194.png
    „Sign in with Twitter“ for your own ASP.NET WebApp

      “Sign in with Twitter” is a popular practice to authenticate the users on your website. One advantage compared to an own registration is the lower inhibition for the user. But on the other hand Twitter doesn’t fess up with all the information’s and you will get into a kind of addiction. At the end ...

  • image1485-570x194_thumb.png
    CodePlex is going to be updated

      CodePlex the Microsoft Open Source Project Hosting Plattform hasn’t changed that much in the last few years and for a few times I thought Microsoft stopped the whole developing process. But now I found out that there is still life in the project. Maybe it is because of the success of GitHub or because ...

  • image1474_thumb.png
    What does Adobe in the flash-free web? Magazine-Style Layouts with CSS Regions!

      Adobe is well known for Photoshop and Flash but of course there is a lot more. According to the “Future Post” from Google Adobe declared one of their big subjects on a Blogpost. I’m talking about the W3C Working Draft to CSS Regions. Adobe cooperates with the WebKit Team and W3C on this. What ...

  • image1471-523x194.png
    HTML 5 Games, Tooling & 3D

      Game Developing is an interesting subject for all kind of software developer. But as a web developer without any Flash-skills there aren’t that much starting points. With HTML5 and the combination between Javascript, CSS3 and fast browsers there are the first “robust” HTML5 games. HTML5 games? Is this real? Neowin created a “Top 10” ...

Support us