This project is read-only.


Download in PDF
  1. Abstract
  2. Introduction
  3. Background
  4. Deploying and Running MoodleAzure
  5. Packaging, Configuring and Deploying the Solution
  6. Implementation Details: What Changed
  7. Horizontally Scaling the Application
  8. Conclusion

Packaging, Configuring and Deploying the Solution

Now that we have setup an appropriate development environment, we need to get the source code, add PHP binaries to our solution, configure our deployment, and run our application on the cloud.

1.       Get the latest zip release of MoodleAzure source code from Codeplex ( You should be able to find it in under the “Downloads” section.

2.       Extract the files to the folder “C:\projects\moodleazure\”, which we created in step 5 of the previous section.

3.       Go to your PHP installation folder. In x86 architectures, this should be “C:\Program Files\PHP”. In x64 architectures it should be “C:\Program Files (x86)\PHP”. Copy all of the files located inside the PHP installation folder EXCEPT FOR “php.ini” -- MoodleAzure source distributions comes preconfigured with a php.ini file --. Paste the copied files on to “C:\projects\moodleazure\MoodleWebRole\php”

4.       Go to: Start Menu > All Programs > Microsoft Visual Studio 2010; right click on the Microsoft Visual Studio shortcut and select “Run as Administrator”. Open up the Unosquare.MoodleAzure.sln file within Visual Studio.

5.       Expand the MoodleWebRole project and configure MoodleAzure by providing the correct values for the settings listed in the table below.

File (line)



config.php (7)


Replace the accountname with your Sql Azure account name

config.php (8)


Make sure there is a “moodle19” database created in your Sql Azure account

config.php (9)


Replace username by the actual Sql Azure username. Replace accountname with your Sql Azure account name.

config.php (10)


Your Sql Azure account password (7)


Replace sitename with the web role account name. (25)


This is your storage services account name. (26)


This is your storage services account key. It is a base 64-encoided key.


6.       Right click on the Unosquare.MoodleAzure Project and select “Publish…”. You can deploy the service directly through Visual Studio by selecting the “Deploy your Cloud Service to Windows Azure” option and setting up your deployment credentials. It might take around 15 minutes to upload the service package, and create the Azure Virtual Machine.

7.       Open up a browser and go to http://(sitename) where sitename is the account name of your web role. The site will take some time to generate a response. If the response takes longer than 35 seconds, it will show a 500 error. This is because there is currently no way of telling FastCGI on Azure to allow for longer execution times. If you get a 500 error, refresh the page. If you get a message that an upgrade is already running, click the (!!!) link. If you get a page indicating that tables were created successfully and there is no continue button, refresh the page. Repeat this procedure until  the database setup is complete.

Last edited Oct 28, 2010 at 5:42 PM by unosquare, version 2


sandipshinde Jul 2, 2011 at 5:36 PM 
I'm getting error like The service is unavailable.