I’ll not be going into detail on how this module was built, but there is a native C++ RoleManager implementation in the Windows Azure samples. Using the resources listed below, I managed to create a PHP extension module, wrapping this RoleManager. The result? You can now retrieve configuration values from the ServiceConfiguration.
$appName = azure_getconfig(“AppName”);
$storageAccount = azure_getconfig(“StorageAccount”);
Next to this, logging is now also exposed: simply call azure_log() and you’re done:
azure_log(AZURE_LOG_INFORMATION, “This is cool!”);
azure_log(AZURE_LOG_CRITICAL, “Critical errors are not cool…”);
Oh, you want to have the path where a localStorage is available? (see here for info)
$rootPath = azure_getlocalresourcepath('teststore');
$pathMaxSizeInMb = azure_getlocalresourcepathsize('teststore');
Want to use it in your own PHP applications hosted on Windows Azure?
The following links have been helpful in developing this:
This is an imported post. It was imported from my old blog using an automated tool and may contain formatting errors and/or broken images.