The Windows Azure SDK for PHP isn’t exactly new, so maybe it doesn’t need an introduction. However, for anyone building PHP applications for the Windows Azure platform, this SDK is essential. Besides, if you haven’t checked out the 4.0 release (or you have never heard of it), then an introduction is in order. In this post, I’ll provide links to resources that will help you get started with and use the SDK. As you’ll see by the links below, I’m leaning heavily on the AzurePHP site maintained by the Interoperability Team at Microsoft.
This post, Set up the Windows Azure SDK for PHP, does a great job of providing an overview of the SDK, showing options for getting it, and showing how to set it up. The diagram below (from that post) shows how the SDK can be divided into three main components:
The 4.0 release of the Windows Azure SDK for PHP introduced the concept “scaffolds” for packaging PHP applications to Windows Azure. If you have been using the Windows Azure Command Line Tools for PHP Developers for this purpose, getting your head around scaffolds takes a little work. Once you get used to using scaffolds, they are quite simple and quite powerful. A scaffold is a PHP/Azure project template in the form of a .phar file. The SDK ships with a default template (in the /scaffolders directory) that you can use to deploy an application – just add your application’s source code to the PhpOnAzure.Web directory of the project produced by running the scaffolder against the default scaffold. This post, Build and deploy a Windows Azure PHP application, will walk you through all the details.
The power of scaffolds becomes evident in these posts:
From those posts you begin to understand how a scaffold can be created for any application. The scaffolder tool then allows anyone to run it and add their application-specific information (e.g. SQL Azure database connection information) and quickly deploy to Azure. For information about creating a scaffold for your own application, see Using Scaffolds.
Within the class library for the SDK, there are classes for accessing the Windows Azure Blob, Table, and Queue storage services. The main classes you’ll use are the Microsoft_WindowsAzure_Storage_Table, Microsoft_WindowsAzure_Storage_Blog, and Microsoft_WindowsAzure_Storage_Queue classes. Details on how to use these classes can be found in these articles (note that some of these tutorials are based on versions of the SDK prior to the 4.0 release, but storage APIs have maintained backward compatibility):
For reference, here are other resources worth checking out:
That’s quite a few resources, but I’m sure there are more out there. If you come across good resources related to the Windows Azure SDK for PHP, please let me know and I’ll add them to this post. As I gather more resources, maybe I can put together a sort of “table of contents” of what’s out there. And, of course, if you are looking for a resource that doesn’t exist, let me know…I’ll write it!
Thanks.
-Brian
Share this on Twitter