A few weeks ago I posted about having Ruby on Rails running on Windows Azure.
At the end of that post I promised that the next post I did would be to explain how to get it up and running. I still have not got around to writing that post
I have had quite a lot of people contact me and ask me for the solution so in order to try and help out anyone who wants to do this I have created a very simple sample solution with some brief instructions and posted it at http://code.msdn.microsoft.com/railsonazure
I still intend to post a step by step walkthrough of the solution in the near future but in the meantime maybe this will be of some use.
Hope this is of some help to someone.
Earlier this year I posted about a demo I put together that showed messages flowing between applications on Windows Azure, Google App Engine and an on premise service.
Recently Simon Guest produced a demo which he used at Tech Ed Berlin and QCon San Francisco that shows application integration between services running on Windows Azure, Google App Engine and Amazon EC2.
Whilst we both based our demos around features provided by the Service Bus Simon’s demo is totally cloud based and used includes a php application as well as .Net and Java.
For more information check out the blog post here.
Last week we announced the availability of some great new Windows Azure features in the November Windows Azure SDK. One of these features enables Worker Roles to receive network traffic from both external and internal endpoints using HTTP, HTTPS and TCP. This new feature enables many new scenarios, one of then is the ability to run existing applications that receive traffic over sockets in Windows Azure.
Using these capabilities as a foundation we have shown the ability to run various applications and technologies such as MySQL, Mediawiki, Memcached and Tomcat. We have also provided a number of solution accelerators – which you can find links to here – in order to make it more more straightforward to get up and running. There are a couple of great PDC sessions here and here that demonstrate and explain how to get going with these technologies.
One of the questions I’ve heard from a number of customers and partners over the last few months has been “Is it possible to run Ruby on Rails on Windows Azure”. Well the answer is now yes. Using these new features and the approach used in the solution accelerators I have Ruby on Rails running at http://rubyonrails.cloudapp.net. There is also an incredibly simple test application running with a SQLite database at http://rubyonrails.cloudapp.net/posts
in my next post I will walk through the steps I took to get this working.
The July CTP release of the Windows Azure SDK and tools is now available.
There are a few new features in the release including:
- The ability to have more than one web and worker role type defined in a service, as was the case previously a service must have at least one role of one type defined but can now have multiple roles of the same type:

Note that each role is instanced (and deployed) independently. Jim Nakashima has a more details and a walkthrough of creating a service with multiple roles of the same type on his blog.
- The ability to associate any Asp.Net Web Application with a Service as a Web Role, again Jim has details here.
One of things that caught my eye is the inclusion of a new sample project in the SDK called PowerShellRole , this sample highlights the fact that Powershell is available - and usable – from Windows Azure. There is a sample web role that enables Powershell commands to be executed, the following screenshot shows using the Clouddrive Powershell provider to list the contents of a blob store:
There is also a worker role that executes powershell script. I am anticipating that this ability to run Powershell scripts will also make it easier (and quicker) to run other scripting runtimes on Windows Azure as it will make it possible to write a script and quickly deploy and run it.
Richard Prodger and Rob Blackwell from Active Web Solutions have just posted about an interesting application that enables the .Net Services Service Bus to used to remotely listen for traffic on any TCP port.
This application enables traffic for specified ports to flow via the service bus even in face of network infrastructure that would otherwise prevent it.
You can find more details about this application here.
The application is available on codeplex.
A couple of weeks ago I posted about some new features that have been made available in the storage service. Steve Marx has a couple of posts about how to use some of these features.
I also noticed that the updated whitepapers on table and blob storage have been published, one thing in particular caught my eye in the table paper:
By PDC 2009, we plan to require the x-ms-version to be specified by all non-anonymous commands. Until then, if no version specified for a given request, we assume that the version of the command the request wants to execute is the CTP version of the Windows Azure Storage APIs from PDC 2008. If a request comes in an invalid x-ms-version, it will be rejected.
So it seems that any existing code that makes authenticated calls to storage will require a header by PDC 2009.
The table paper also has some useful tips on performance if you are using .Net as your client framework.
The Bing maps team have put together a nice application running on Windows Azure that lets you explore the terabytes of updated data they publish each month.
You can take a tour of the new hotspots or explore for yourself here. There’s also a short video intro to it here and more info on Chris Pendleton’s blog.
If you want to see another interesting Bing maps application on Windows Azure take a look at Earthware’s twitter mash up.
Both these applications require Silverlight
Hot on the heels of the updated Windows Azure May SDK and Tools CTP release the Windows Azure Storage Team have released some new features.
Highlights include:
Entity Group Transactions for Table Storage – operations can be batched together so that operations are performed atomically where those operations are performed on entities from the same table with the same partition key. Besides the atomic nature of updates this change also enables multiple changes to be requested in one roundtrip to the server.
Copy Blob – a blob can be copied in its entirety to another blob in the same account, this change enables backup, versioning and renaming of blobs.
API Versioning – a new header has been introduced to enable versioning of APIs, all new features\APIs require the presence of this header to work.
One thing to note is that whilst the service has been updated the SDK has not been revised to reflect these changes at this time, the upshot of this is that in order to use these features you need to either the REST interface or the ADO.Net Client Library and not the Sample Library from the SDK.
More details can be found here.
One of the many important questions that arises when talking to customers and partners about cloud computing is about security, privacy and reliability of systems when hosted in the cloud.
The infrastructure that Microsoft runs to support both our services is provided and managed by a part of the organisation called Global Foundation Services. They have just launched a blog at http://blogs.technet.com/gfs.
The first post on that blog addresses the subject of how we approach the the task of securing the infrastructure that run our services, there is also a white paper with much more detail.
One of the areas discussed in the paper is certification, ISO/IEC 27001:2005 certification is a common request, you can see details of Microsoft ISO/IEC 27001:2005 certificates here.
Alongside publication of the white paper on infrastructure another white paper that discusses security and reliability as it relates to Microsoft Online Services has been published here.
Windows Azure tools team have just released an update to the SDK and Tools, along with some general improvements in robustness and bug fixing the major feature is support for Visual Studio 2010 Beta full details at http://blogs.msdn.com/jnak/archive/2009/05/28/may-ctp-of-the-windows-azure-tools-and-sdk-now-supports-visual-studio-2010-beta-1.aspx
Following on from yesterdays post on integration via the cloud using .Net Services and the .Net Service Bus I just noticed that there are a great set of White Papers for developers written by Pluralsight covering .Net Services and each of the three constituent pieces, Service Bus, Access Control and Worklow.
You can download each of the papers from the Microsoft Download Site
A few weeks ago at the Architect Insight Conference I showed a very simple demonstration that highlights some of the building block services Microsoft is delivering in the cloud as part of the Azure Services Platform.
My intention was to show off a couple of aspects of Azure. Firstly the emergence of cloud computing not only creates an opportunity for the use of the cloud as a place to execute applications – in our case Windows Azure - but in addition provides the opportunity to provide services that developers can take advantage of in their applications, regardless of where those applications are running. Second I wanted to show off the fact that these services are – and need to be - interoperable with services and applications on other platforms.
One of the building block services that we are making available as part of Azure is .Net Services, in a nutshell this service is aimed at making it easier to integrate applications together. One of the core components of .Net Services is the Service Bus which “provides the familiar Enterprise Service Bus application pattern, while helping to solve some of the hard issues that arise when implementing this pattern across network, security, and organizational boundaries, at Internet-scale.”
I therefore chose to build a very simple application that showed how the Service Bus could be used to integrate an application running in Windows Azure , an application running in Google App Engine and an application running behind the firewall.
I followed the tutorial in Google App Engine to build the guestbook application in Java. This application provides a form which allows a user to leave a message which is persisted to storage. The application then renders the stored message back to the user. After building this application I added two pieces of functionality:
- When a message is posted as well as saving it I also POST it to the service bus.
- A REST style web service that accepts messages and persists them to the local store
The completed application looks like this:
I then implemented the exact same functionality in Windows Azure:
Finally I created a console application that does two things. First it exposes a REST style web service through WCF, this service accepts messages sent to it and displays them in its console window. Second it creates a number of objects in the service bus that connect the three different services together:
- It creates a service endpoint in the service bus so the web service running in the console application is reachable. One of the features of the Service Bus is to provide a relay in the cloud to enable a service to be reachable even if that service is running on a machine behind a NAT device or firewall with a dynamic\private IP address. Rather than opening a port and listening locally the service in the console application then makes an outbound connection to the service bus and messages for it are forwarded.
- It creates a router object in the service bus at the URI that the application in Google App Engine POSTs to, it then subscribes the web service in the console application and the web service in windows Azure to the that router. This service bus router enables both the forwarding of all messages it receives to all of its subscribers and the ability to queue messages the event of one of the subscribers being unable to process messages.
- It creates a second router object in the service bus at the URI that the application in Windows Azure POSTs to, it then subscribes the web service in the console application and the web service in Google App Engine to the that router.
The end result of this is that whenever a message is posted to either of the web applications that message is forwarded to the other web application and the console application. The following diagram shows a view of the whole system.
This demonstration shows a number of benefits of using the service bus to integrate applications together:
- Each of the web applications is decoupled from the services that receive its messages, the message can be sent once and forwarded to any interested receiver (that has permission to receive the message)
- This message integration is asynchronous, in addition the messages can be transparently queued in the service bus providing protection against the receiving service being unavailable, unreachable or busy.
- Services running on devices that are not reachable from the Internet because of being on a private network behind a NAT or firewall device can be made discoverable and callable.
The following video is a screen capture of the demonstration running, to learn more about .Net Services and the Service Bus visit the Azure Services Platform Developer Centre on MSDN.
The March CTP release of the Windows Azure SDK includes support for the IIS 7 FastCGI module which means that php applications can now be run in Windows Azure. I thought I’d take a look at how to set it up, I’ve not set up FastCGI on IIS7 on Windows Server before and I don't know anything about php, this is how I got it going.
I didn’t have php installed on my system so I installed it via the Microsoft Web Platform Installer 2.0 Beta
First I created a solution with no roles in using the Blank Cloud Service project in Visual Studio
Next I added a new web role to it by selecting the role folder in the cloud project, right clicking and then selecting add new web role project, I then selected the Cgi Web Role template
I then created a new php folder in my web role project and added the files from the c:\program files\PHP folder. In order to get the php runtime files part of my deployment I also selected all the files and changed their build action to content and set them to be copied to the output directory if they changed
Next I edited the Web.roleconfig file like so:
<?xml version="1.0"?>
<configuration>
<system.webServer>
<fastCgi>
<application fullPath="%RoleRoot%\php\php-cgi.exe" />
</fastCgi>
</system.webServer>
</configuration>
I also needed to enable Full trust code by editing the cloud projects ServiceDefinition.csdef file, adding the attribute enableNativeCodeExecution:
<WebRole name="WebRole" enableNativeCodeExecution="true">
Finally in order to route requests for php files to the php interpreter I added the following to the handlers section in the of the web.config file i my web role.
<add name="PHP FastGGI Handler"
verb="*"
path="*.php"
scriptProcessor="%RoleRoot%\php\php-cgi.exe"
modules="FastCgiModule"
resourceType="Unspecified" />
At this point I was ready to try and run a php script, so created a new text file in my web role called hello.php and then added the following content:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
Now I was ready to run my “app” so I hit F5 in visual studio, unfortunately I then received an error from php-cgi.exe saying that the application had failed to start because it could not find ntwdblib.dll, a few searches later and I found out the attempt to load this dll was because of a configuration entry in php.ini. (There is some guidance about how to configure php.ini on windows here)
I edited php.ini and commented out the SQL Server extension and the error was gone.
[PHP_MSSQL]
;extension=php_mssql.dll
I also created a second php script that called the php phpinfo() function, you can see that here
After I completed this I realised that a lot of php developers would not use Visual Studio, Ryan Dunn has a post explaining how get php going with only the Windows Azure SDK here
The blog entry here talks about how to use a non default SQL Server instance as the store for the developer storage fabric in the Windows Azure SDK. The good news is that the March CTP fixes this issue. In order to specify a different SQL Server instance simply issue the command dsint /sqlinstance:<your instance name> from the bin folder in the SDK.
Note that you cannot specify a server name, the instance is assumed to be on your local development machine.
The March CTP release of Windows Azure has a number of interesting new features amongst them is the ability to run applications in full trust mode.
Full trust mode in Windows Azure enables a number of scenarios not previously available, amongst these are:
- Executing code in assemblies that require Full Trust callers.
- Executing native code via P/Invoke.
- Spawning new processes.
Note that the account that your code will run with is a standard user account NOT one with administrative privileges'.
This post covers a quick walkthrough of the first scenario using Visual Studio, producing a simple web page that uses classes from the System.Management namespace to display information about the processes running on the host machine our service is running on.
1.Create a new Web Cloud Service in Visual Studio.
Rather than just let any application run as full trust in Windows Azure you have to configure your service roles to allow native code execution.
2. Alter your web role ServiceDefinition.csdef file
<WebRole name="WebRole" enableNativeCodeExecution="true">
3. Next, add a reference to the System.Management assembly in your web role project
4. To display the list of processes that are running on our host we use an ASP.Net gridview control, add the following to the default.aspx page
<asp:GridView ID="ProcessView" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="ProcessName" HeaderText="Process Name" />
<asp:BoundField DataField="ProcessStarted"
HeaderText="Date and Time Process Started" />
<asp:BoundField DataField="MaxWorkingSet"
HeaderText="Maximum Working Set Size" />
</Columns>
</asp:GridView>
5. Lastly, add the code to default.aspx.cs Page_Load method
ManagementClass Processes = new ManagementClass("Win32_process");
ProcessView.DataSource =
from ManagementObject process in Processes.GetInstances()
select new
{
ProcessName = process["Name"],
ProcessStarted=process.GetPropertyValue("CreationDate"),
MaxWorkingSet = process["PeakWorkingSetSize"]
};
ProcessView.DataBind();
That’s it, if you compile and run this code then you should see a list of processes running on your development machine along with their creation time and peak working set size.
If you go back to the ServiceDefinition.csdef and alter the value for the attribute enableNativeCodeExecution to false (or remove it) then you will see output similar to this when you attempt to run your code.
![clip_image002[11] clip_image002[11]](http://blogs.msdn.com/blogfiles/simondavies/WindowsLiveWriter/HowToRunFullTrustApplicationsinWindowsAz_8AF6/clip_image00211_thumb.jpg)
For completeness this is the output I see when I run my code in the Windows Azure cloud rather than on my dev machine.
![clip_image004[10] clip_image004[10]](http://blogs.msdn.com/blogfiles/simondavies/WindowsLiveWriter/HowToRunFullTrustApplicationsinWindowsAz_8AF6/clip_image00410_thumb_1.jpg)
I’ve put a copy of the page here so you can see the output live.
Technorati Tags:
Azure,
Windows Azure