Download them here.
New in the November 2009 SDK (quote from Microsoft Windows Azure team newsletter):
As we can see – a lot of improvements and new features introduced in this release. I will made review of them right after will have time to check (hopefully today later)! In any case, glad that MS improve Azure SDK so quickly!
Update: after installation and first review, I found following:
Because I build Evejob multi-platform project with support of Cloud deployment scenarios (currently for Google App Engine and Microsoft Azure) and I am sure that best Web software must be ready to be deployed in Cloud(s), it was very interesting to read latest announcement from Amazon: “… AWS Software Development Kit (SDK) for .NET Now Available… “.
Sure it’s just a beginning for Amazon in development of real .NET SDK, but even with this version we can quickly build .NET applications that tap into AWS Cloud. Yes, even before developers have good libraries to build such applications, but now looks like we have first “standard” API from Amazon and this fact is very important!
For example, for Ruby there is no such official SDK (or Ruby gem), and developers can choice from few available gems (right_aws, amazon-ec2 or AWS:S3 to name just few). The same situation for Java - available a lot of “community” libraries, but no official SDK… (ok, ok, for Java we have at least official AWS Toolkit for Eclipse, but Toolkit it is not SDK!!!).
But why it is important to have official “language specific” SDK?
Well, first of all, now because Amazon have few BIG rivals, like Google App Engine (and we know that Google DO have official SDKs, more so, for both Python and Java!) and Microsoft Azure (sure Microsoft always have SDKs – it a BIG plus for Microsoft!).
Also it is important for developers, so they know that if they take some library and put this library as “base” for communications with a Cloud, they will not need to dial with changes in API in case of library author decide to drop development! It is important to have SDK that will be up to date with company services (Amazon in our case), just because we developers want to be SAFE! Sure it is good if there are a lot of open source libraries that EXTEND SDK some way, but it’s just “add-ons” and can’t replace real official SDK!
So it is really BIG day for Amazon and .NET developers – first official “language specific” SDK, and for .NET!!! What will be answer from Microsoft Azure that is still in “Beta”?
Note: in this post I mean “language specific” SDK, not just common SDK that list API for Web Services with samples how to use them for example, etc… Because most of they time developers dial with some specific language, it is important for services like AWS to provide language specific SDKs so developers can really quickly and “safely” create applications using such “language specific” SDKs! Hope you understand what I mean
Ruby installation
Let’s start from Ruby installation. We can download Windows One-Click Installer from http://rubyforge.org/frs/?group_id=167, for example ruby186-27_rc2.exe
During installation, make sure that you select at least “Enable RubyGems” option:
You can leave default installation folder (C:\Ruby).
Ones you finish installation, you can run both “ruby” and “gem” from withing your command line.
So it’s time to install Rails, just type in command prompt:
gem install rails
and wait few minutes to finish installation.
JRuby installation
Download installation package from http://jruby.org/download. We will need binary Windows version, for example JRuby 1.4.0RC1 Binary .zip. Extract folder content to C:\JRuby folder and add path to the JRuby to your PATH variable:
Let’s test installation:
Now both Ruby and JRuby installed.
The problems starts when we will try to simultaneously use them (side by side)… First of all, make sure that you delete RUBYOPT environment variable (because it seems like JRuby gems did not work correctly if this variable setup). Now you can invoke each “gem” using following commands:
For Ruby: ruby -S gem
For JRuby: jruby -S gem
For example this is what I get on my machine:
Note: it is actually not a big problem that I had 2 different versions of Gem on my machine – both versions (1.3.1 and 1.3.5 works well for me… update of gem 1.3.1 fails for some reasons on my machine, so I decide to leave this for now…)
One small thing to do: it is possible that you have old version 1.3.1 of RubyGems like me (in the moment when I write this, latest version is 1.3.5 like was installed for JRuby). If we leave it, we can face some problems in future with IDEA etc, so let’s just update it:
Also, let’s install jruby-openssl (IDEA generate Error if this gem not installed):
Rails Installation
Next step is installation of Rails – just type following commands (it is better to just install Rails twice than to share same installation for both Ruby and JRuby):
ruby -S gem install rails jruby -S gem install rails
EvejobRoR and EvejobRoRG Project
We going to create 2 separate projects now:
EvejobRoR – will use Rails build in ActiveRecord + MySQL database
EvejobRoRG – will use App Engine hosting, datastore and Google Accounts for user authentication APIs
Let’s start from more simple EvejobRoR:
cd c:\evejob rails EvejobRoR -d mysql
Now let’s open this “template” project in IDEA:
File -> New Project -> Create project from scratch:
Change here “Project files location” to the “C:\evejob\EvejobRoR”, select “Ruby Module” and press next (see screenshot above)
Now you need to specify the Ruby SDK (current version of IDEA can’t detect SDK locations from environment variables). Press “Configure…” button and press “+” button in “Configure JDK” window:
Select “Ruby SDK” in popup and than select Ruby interpreter path:
I Hope you will get something like this:
If so, just press “OK” and continue IDEA project creation Wizard:
Select “Ruby on Rails” on next screen and press “More…” for Rails Facet configuration:
Make sure that you select “Use existing Rails application” and “Preconfigure for selected database” to “mysql” like (see picture above)
Now fill free to finish project creation Wizard. Done! We get EvejobRoR project loaded into IDEA.
Same steps we need to made for EvejobRoRG project, with small difference that this time we need to add JRuby SDK, instead of Ruby SDK like before and that we don’t want to support mysql as we are going to use Google App Engine API instead.
So, first type:
cd c:\evejob rails EvejobRoRG
Then same like before, create new project in IDEA, put here “C:\evejob\EvejobRoRG” path and in “Specify the Ruby SDK” press “Configure…” and add JRuby SDK:
After made same steps like was done for EvejobRoR project, just make sure that you unselect “Preconfigure for selected database” check box in Rails Facet Settings dialog and process steps like before to finish Wizard.
Hopefully you get EvejobRoRG project opened in IDEA!
Prepare JRuby / Rails for Google App Engine
Google App Engine runs Java applications, so we need to make sure that we can assemble our JRails applications into a Java Web Archive (.war). To do such tasks easy, let’s first install “warbler” gem:
jruby -S gem install warbler
Now it is time to check that you add Java JDK path to windows PATH environment variable (because “warbler” gem use JDK):
Next step, to run following commands from application root folder (c:\evejob\EvejobRoRG):
jruby -S warble pluginize jruby -S warble config
(make sure you type “warble”, not “warbler” that is just Gem name)
Now you can just check that “Warbler” works:
jruby -S warble
As result you must see EvejobRoRG.war file generated in application root folder (c:\evejob\EvejobRoRG)
We can’t use this .war file directly for Google App Engine for few reasons, but at least we see that we can get some .war file
I specially not use all appengine-jruby project gems for few reasons:
But what I do use is one of the gems from appengine-ruby project – “appengine-apis”, so let’s install it:
jruby -S gem install appengine-apis
Read this for now to get more information about Rails and Google App Engine specific things:
http://olabini.com/blog/2009/04/jruby-on-rails-on-google-app-engine/
http://www.railshacks.com/2009/4/25/run-your-ruby-on-rails-app-on-google-app-engine
We will get back to this later…
OK, let’s start installation of the development environment from Python + Django.
Here is step by step instructions:
1) Go to http://www.python.org/download/. Download 64 bit Python (if you use Windows 7 64 bit like me or other 64 bit OS) version 2.6.x (do not install version 3.x as Django not yet available for this Python version) – usually file have name like “python-2.6.x.amd64.msi”. I recommend to change setup path to C:/Python, instead of C:/Python26
2) Go to Control Panel\System and Security\System in Explorer. Than press “Advanced System Settings”. In System Properties window go to “Advanced” tab and press “Environment Variables” button. Here you need to add path to python in “System Variables”. Just found here “Path” and append “C:\Python”.
Note: I show here and will show in future ways how to finish tasks using windows GUI (if available), instead of command prompt commands (for example instead of usage of PATH command). Sure thing most of operations now can be done using command prompt, especially after introduction of PowerShell by Microsoft (it is build in to Windows 7 / Windows 2008 R2)
3) Go to command prompt (cmd.exe) and check that you can run actually Python by typing “python”.
4) To grab latest source code from SVN repositories (for Django and other soft), let’s install now Subversion Client from http://www.collab.net/downloads/subversion/. I suggest to have this client even in case if you going to use TortoiseSVN. Why? Reason very simple – ones you study how to use it, you will know how to work with SVN in ANY OS, not only in Windows! It is exactly example, when better to use command prompt commands, instead of GUI like I recommend above – in such cases you will be familiar with command that runs on all kinds of operation systems!
You can download installation after simple registration. Ones you install SVN client, go to command prompt and try to enter “svn” command. Hopefully you will get something like this:
4) I will use so called “development version” of Django. To install it you need to execute following command:
svn co http://code.djangoproject.com/svn/django/trunk/ C:\django-trunk
This will download latest source code for Django and save it in C:\django-trunk folder. Now it is time to setup PYTHONPATH variable (same way like in topic 2, but this time you need to create new variable, not just edit existed one!)
And before you leave Environment Variables, let’s add to the PATH variable location of Django bin folder (C:\django-trunk\django\bin):
Now it is time to check this setting:
Great Django installed!
One more simple step in installation of gettext-utils that used in Django translation system: go to the http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/ and download latest gettext-runtime-X.zip and gettext-tools-X.zip files. Extract content from bin folders of archives to c:\gettext-utils folder and add this path to PATH variable, same way like add before another locations (see details in topics above):
5) Now it is time to overview folders structure for project:
- C:\Evejob will be home directory for all source code for Evejob project
- C:\Evejob\EvejobDJ will be home directory for Django version of Evejob
- C:\Evejob\EvejobDJG will be home directory for Django + Google AppEngine version of Evejob.
Now, let’s run in command prompt following commands:
Let’s check that at least Django build-in web server works fine:
Please note: Django version can be different on your machine!
Open in browser http://127.0.0.1:8000 and make sure you see something like this:
The same way, let’s create EvejobDJG Project that will be tuned up to work with Google AppEngine (all command like before, just EvejobDJG used instead of EvejobDJ):
6) Django and AppEngine integration
Ok, now let’s install Google AppEngine SDK for Python available at http://code.google.com/intl/en/appengine/downloads.html#Google_App_Engine_SDK_for_Python
I assume that SDK will be installed in following folder: C:\Google\google_appengine\
Also we will need to install the Python for Windows extensions to enable automatic detection of the SDK. Be careful and download 64 bit version, for example pywin32-214.win-amd64-py2.6.exe if you use Windows 64 bit like me. Installation will automatically found your Python language, so if you download correct version of pywin, you will not get any problems during installation at all.
7) Today available few helpers (projects) that can help us create Django application that will be hosted on Google App Engine.
More specifically exists two: Google App Engine Helper for Django (http://code.google.com/p/google-app-engine-django) and App-Engine-Patch (http://code.google.com/p/app-engine-patch)
Each library have own features, but main difference that with App-Engine-Patch you have to use Google’s Model class, while with Google App Engine Helper you can use BaseModel class that appears the same as the standard Django Model class…
Here are some interesting articles related to Django and AppEngine combination:
http://code.google.com/appengine/articles/django.html
http://code.google.com/appengine/articles/appengine_helper_for_django.html
http://www.42topics.com/dumps/appengine/doc.html
http://www.42topics.com/dumps/django/docs.html
http://thomas.broxrost.com/2008/04/08/django-on-google-app-engine/
I will come back to this libraries later, ones finish with more simple EvejobDJ standard Django Model…
.NET development Environment Installation
Creating EvejobNET Solution
Open Visual Studio, select “File / New Project” and fill form with following details (make sure you select ASP.NET MVC Web Application template):
Press “OK” and on next window “Create Unit Test Project”, select “Yes” and press OK:
You will get solution loaded into Visual Studio with 2 projects: ASP.NET MVC Application (EvejobNET) and Unit Tests project (EvejobNET.Tests):
You can now try to run it, just press “Start Debuging” Button and make sure that you agree with action to “Modify the Web.config file to Enable Debugging”. Your default browser will open test site, hosted by development server (build in into Visual Studio).
Creating EvejobAzNET Azure Solution
Go to “File / New Project”, select “Cloud Service” template in New Project Window and fill project name and path like on following screenshot:
After you press “OK” you will need to select Roles to be added to solution. At the time I write this, there was no ASP.NET MVC role available, so let’s just temporary add ASP.NET Web Role (keep default name for now):
After you press OK, solution will be opened with WebRole1 Project. Now it is time to remove “WebRole1″ temp project from solution (don’t forget to delete unused folder, with content, WebRole1 in C:\evejob\EvejobAzNET).
Next step is to add new ASP.NET MVC project: like was done above for EvejobNET project – just simply right click in solution explorer on “Solution ‘EvejobAzNET’” and select “Add New Project”, than select ASP.NET MVC Web Application Template and give this template name “EvejobAzNETMvcWebRole” to keep Azure standard naming convention.
One more step to finish – you need to associate role, so in solution explorer right click on “No project associated (WebRole1)” and select same like on screenshot:
In opened window for association, make sure that you select “EvejobAzNETMvcWebRole” project:
Your solution will looks like this now:
Now it’s time to test it – just press “Start Debugging” in Visual Studio. Probably you will get following question (if everything going well):
Sure thing, correct answer “Yes” Ones it finished you will get another window that show “Development Storage Initialization” – just press “OK” button here and continue with execution.
You can get following popup also:
I hope you answer yes, as probably you want to be sure that you use latest Tools available for Azure
Finally, your default browser probably opens with http://127.0.0.1:81/ Url and you will see “My MVC Application”
If so, that we just prepare everything to start EvejobAzNET development
Ah, one small note – you can check status in “Development Fabric” and in “Development Storage” – small icons are added to Windows taskbar – right click on each and select “Show …”:
Thats it!