Windows Azure Companion for PHP – Source code Study

Once you have download the the from the link below it is good to take a look at 5 source code location described in this blog:

Here I will show you a 5 source locations which are important to understand the solution architecture. You can make necessary modifications in these areas if you wish and add little extra code to get more from the solution. These 5 sources locations are described as below:

1. Azure Companion Administrator Application:



             // Start ASP .NET Admin WebSite

       private void StartAdminWebSite()

2. Running PHP in Hostable Web Core:



             public static string HWCForPHPProcessName = "HWCForPHP.exe";



// setting the file name and arguments

              hwcServerProcess.StartInfo.FileName = Path.Combine(approot,


              hwcServerProcess.StartInfo.Arguments =

                    Path.Combine(configPath, "php_applicationHost.config") + " "

                    + Path.Combine(configPath, "php_web.config");


              // Start the asynchronous read of the output stream.



              Trace.TraceInformation("Started Hosted Web Core Server for PHP Applications

 on port {0}", endpoint.Port.ToString());


3. Performance Counter for RAM utilization:


// Add performance counter monitoring


                            new PerformanceCounterConfiguration()


                               CounterSpecifier = @"\Processor(_Total)\% Processor Time",

                               SampleRate = timeSpan



                new PerformanceCounterConfiguration()


                    CounterSpecifier = @"\Memory\Available Mbytes",

                    SampleRate = timeSpan


            cfg.PerformanceCounters.ScheduledTransferPeriod = timeSpan;


4. Cloud Drive is created and backup.vhd is mounted:


// Get Windows Azure Drive container and blob names from service configuration file

string xdriveContainerName = RoleEnvironment.GetConfigurationSettingValue("PHPApplicationsBackupContainerName");

string xdriveBlobName = RoleEnvironment.GetConfigurationSettingValue("XDrivePageBlobName");


5. Modifying Cloud Drive name, size etc:


      <!-- Settings for Windows Azure Drive used for durability -->

      <Setting name="PHPApplicationsBackupContainerName" value="phpapps" />

      <Setting name="InstallationStatusConfigFileBlob" value="status.xml" />

      <Setting name="ProgressInformationFileBlob" value="progress.xml" />

      <Setting name="XDrivePageBlobName" value="backup.vhd" />

      <Setting name="XDriveSizeInMB" value="2000" />


Comments (0)

Skip to main content