You have a PHP application that targets PHP 5.3. You want to deploy it to Windows Azure. You do not have Visual Studio.  How do you do it?

Step 1 – Download The Windows Azure SDK (9 MB).

Step 2 – Download this .zip folder which will serve as the shell directory structure for your files. Unzip it.  It looks like this:


Step 3 – Copy/Paste your web directory into the /AppFolder directory.  This would include all your .php, .html, .jpg and all other assets for the website. Do not delete any of the sub directories that exist in the AppFolder directory, such as the /bin folder or the /assets folder.  Also, do not delete the web.config that is in the /AppFolder directory.

Step 4 – Run the PackageCloud.cmd from the /root directory. This will create a file called ServiceDefinition.cspkg in the /root. 

Step 5 – Log in to Create a New Hosted Service.  When asked to chose a package, browse to the ServiceDefinition.cspkg that you created in Step 4.  When asked to upload a Configuration file,  ServiceConfig.cscfg which can also be found in the /root directory.

That’s it!  Note that the ServiceConfig.cscfg creates two instances of your site.  You can change your instances by changing the number established in that file, which is an xml file.

You can see the what default modules are supported by PHP on Azure looking at this page, which is a website I deployed to Azure using this very package. If you have php modules that you need deployed that aren’t here, you’ll need to add them to the /putmoduleshere directory and redeploy.  Note: I haven’t tested this, so I can’t guarantee it will work. If you do use this methodology to add PHP modules to Azure, leave a comment on this blog and report back your findings.

If you need to update any of the files for you website, you will need to copy those new files into the AppFolder directory and repeat steps 3 – 5.

Thanks to David Aiken and SyntaxC4’s post for helping to figure this out.  Both of these guys are Azure rockstars.