I have a WebApp with an AspNetCore WebAPI + AngularApp on Azure with IIS rewrite rules in my Web.Config based on this article: https://weblog.west-wind.com/posts/2017/Apr/27/IIS-and-ASPNET-Core-Rewrite-Rules-for-AspNetCoreModule
I would like to avoid rewriting on Swagger, so I added this rule as the first rule:
<rule name="swagger" enabled="true" stopProcessing="true">
<match url="swagger/.*" />
<action type="None" />
</rule>
Based on this website: https://www.regextester.com/
The rules is supposed to exclude swagger/ and all the subfolders and files too. But It s not the case.
This is what I can see when I open http://[MYWEBSITE]/swagger/
The Angular app works correctly.
I already made some search about that:
How to exclude a directory with IIS URL rewriting?
How to Exclude Directories from Rules in Web.config (ASP.NET)
https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-configuration-reference
Thanks for your help.
EDIT 1:
Just to let you know, with the default web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\[MYWEBAPP].Api.dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" />
</system.webServer>
</configuration>
I can correctly see Swagger working:
EDIT 2:
During my tests, I removed the rewrite rules to focus only on the Handlers and I noticed that theses rules make problem:
It s normal, Swagger is build in the .NetCore WebApi. I m looking for a way to exclude a specific folder from a handlers.
Based on this response: IIS Handlers exclude a Directory when processing htm requests
I created a web.config in 'D:\home\site\wwwroot\wwwroot\swagger' on Azure with the following configuration:
<system.webServer>
<handlers>
<remove name="StaticFileModuleHtml" />
<remove name="StaticFileModuleJs" />
<remove name="StaticFileModuleCss" />
<remove name="StaticFileModulePng" />
</handlers>
</system.webServer>
EDIT 3:
Clearly the problem comes from the Static handlers.
If I want to use Swagger, I need to disable them.
If I want to access to my angular App, I need to add them.
I saw here: https://github.com/domaindrivendev/Swashbuckle.AspNetCore#swashbuckleaspnetcorecli
That it seems possible to extract the content from the SwaggerUi directly in a folder on built, but currently, the Nugget Package is not available:
https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/601
I will keep you update. If someone has an idea, it will be helpful. I m probalbly not the only to try to do that :).
But the problem is still there.
I finally found a solution!
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wwwroot-static" stopProcessing="true">
<match url="([\S]+[.](html|htm|svg|js|css|png|gif|jpg|jpeg))" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_URI}" pattern="swagger/" negate="true" />
</conditions>
<action type="Rewrite" url="wwwroot/{R:1}" />
</rule>
<rule name="empty-root-index" stopProcessing="true">
<match url="^$" />
<action type="Rewrite" url="wwwroot/index.html" />
</rule>
<rule name="AngularJS-Html5-Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="api/" negate="true" />
<add input="{REQUEST_URI}" pattern="swagger/" negate="true" />
</conditions>
<action type="Rewrite" url="wwwroot/index.html" />
</rule>
</rules>
</rewrite>
<handlers>
<add name="StaticFileModuleHtml" path="*.htm*" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
<add name="StaticFileModuleSvg" path="*.svg" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
<add name="StaticFileModuleJs" path="*.js" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
<add name="StaticFileModuleCss" path="*.css" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
<add name="StaticFileModuleJpeg" path="*.jpeg" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
<add name="StaticFileModuleJpg" path="*.jpg" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
<add name="StaticFileModulePng" path="*.png" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
<add name="StaticFileModuleGif" path="*.gif" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\[MYWEBAPP].dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" />
</system.webServer>
</configuration>
My mistake during the Edit 2 was to create a Swagger folder in wwwroot/wwwroot instead of wwwroot/ directly.
Here is the web.config to add in wwwroot/swagger:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<!--We need to add this web.config to avoid conflict on Azure between Angular App and Swagger -->
<remove name="StaticFileModuleHtml" />
<remove name="StaticFileModuleSvg" />
<remove name="StaticFileModuleJs" />
<remove name="StaticFileModuleCss" />
<remove name="StaticFileModuleJpeg" />
<remove name="StaticFileModuleJpg" />
<remove name="StaticFileModulePng" />
<remove name="StaticFileModuleGif" />
</handlers>
</system.webServer>
</configuration>
You can now access to:
http(s)://[MYWEBAPP]
http(s)://[MYWEBAPP]/[ANGULAR ROUTE]
http(s)://[MYWEBAPP]/Swagger
I hope it will help someone :). If you have any questions, please ask.
First of all, because Swagger does not make a real folder, so it is not a perfect idea to make a folder in wwwroot named swagger and make that web.config inside of it. I consider that the default address for your swagger UI is: localhost:[random-port-number]/swagger/index.html. It can be different based on your swagger version and you can also change it to something else like below:
app.UseSwagger(c =>
{
c.RouteTemplate = "SampleApi/swagger/{documentName}/swagger.json";
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/SampleApi/swagger/v1/swagger.json", "Sample API");
c.RoutePrefix = "SampleApi/swagger";
});
For more information see this article. The version of my Swashbuckle.AspNetCore is 4.0.1
I also added API to the routes in order to be able to use your Microsoft web APIs in your project from font-end by React or Angular or anything else,
you just need to add this to your main web.config in the project:
<rules>
<rule name="wwwroot-static" stopProcessing="true">
<match url="([\S]+[.](html|htm|svg|js|css|png|gif|jpg|jpeg|ico|axd))" />
<!--Handle static file requests and server them from the wwwroot-->
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_METHOD}" pattern="GET|HEAD" />
<add input="{REQUEST_URI}" pattern="/swagger/.*" negate="true" />
</conditions>
<action type="Rewrite" url="wwwroot/{R:1}" />
</rule>
<rule name="html5-routes" stopProcessing="true">
<match url=".*" />
<!-- Handle all paths except /api/ and pass the route onto the wwwroot/index.html -->
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<!-- Add rule to negate file requests e.g. css/html/images-->
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<!-- Add rule to negate directories-->
<add input="{REQUEST_URI}" pattern="^/api/" negate="true" />
<add input="{REQUEST_URI}" pattern="/swagger/.*" negate="true" />
<!-- Add rule to negate paths and let them through the MVC-->
<add input="{HTTP_METHOD}" pattern="GET|HEAD" />
</conditions>
<action type="Rewrite" url="wwwroot/index.html" />
</rule>
</rules>
Related
I am trying to remove .html extensnion during the browse in iis when i browse localhost that should show index or default html that is not showing and when i browse any file in folder with extension.html as o that says HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. thought the file exist.
my web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.html" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="iisstart.htm" />
<add value="default.aspx" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Hide .html ext">
<match url="^(.*)" ignoreCase="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}.html" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="{R:0}.html" />
</rule>
<rule name="Redirecting .html ext" stopProcessing="true">
<match url="^(.*).html" />
<conditions logicalGrouping="MatchAny">
<add input="{URL}" pattern="(.*).html" />
</conditions>
<action type="Redirect" url="{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Please make sure you have URL Rewrite feature installed in your IIS.
see the image
If it's not available, then click on Get New Web Platform Components on right hand side, search for URL Rewrite and install it. Reopen the IIS Manager.
Click on your site and open the URL Rewrite feature. You can explore your rewrite rules which are there in web.config file. see example here
I'm running Joomla 2.5 on an IIS7 server.
The problem is Joomla's search engine friendly urls don't work. Whatever url I enter, it goes to index.php.
After a painful day of struggling with rewrite rules and IIS settings, I came to two realizations:
Search engine friendly urls are only broken when the urls are unicode.
In my WAMP server, on which the SEF urls work perfectly:
$_SERVER['REQUEST_URI'] is "mydomain/%D9%85%D8%AD%D8%B5%D9%88%D9%84%D8%A7%D8%AA/%D9%82%D9%84%D8%A8%DB%8C-%D8%B9%D8%B1%D9%88%D9%82%DB%8C"
But in IIS
$_SERVER['REQUEST_URI'] is "mydomain/???????/????-?????"
It looks like urls are not URLEncoded.
I have enabled unicode aliases, search engine friendly urls, and rewrite in Joomla's global configuration.
I have copy/pasted the web.config.txt into my web.config.
Here is my web.config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings />
<connectionStrings>
****
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=****" />
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=****" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=****" />
</assemblies>
</compilation>
<customErrors mode="Off" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
</system.web>
<system.webServer>
<directoryBrowse enabled="false" />
<defaultDocument>
<files>
<clear />
<add value="Default.htm" />
<add value="default.html" />
<add value="Default.asp" />
<add value="default.aspx" />
<add value="default.php" />
<add value="default.pl" />
<add value="default.cgi" />
<add value="index.htm" />
<add value="index.html" />
<add value="index.asp" />
<add value="index.aspx" />
<add value="index.php" />
<add value="index.pl" />
<add value="index.cgi" />
<add value="iisstart.htm" />
<add value="_holding.html" />
</files>
</defaultDocument>
<security>
<requestFiltering>
<hiddenSegments>
<add segment="backup" />
<add segment="oldsite" />
<add segment="logs" />
<add segment="tmp" />
<add segment="upload" />
</hiddenSegments>
</requestFiltering>
</security>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/" responseMode="ExecuteURL" />
</httpErrors>
<rewrite>
<rules>
<clear />
<rule name="Common Exploit Blocking" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAny">
<add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" />
<add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" />
<add input="{QUERY_STRING}" pattern="(\<|%3C).*script.*(\>|%3E)" />
<add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" />
<add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" />
</conditions>
<action type="Redirect" url="index.php" appendQueryString="false" redirectType="SeeOther" />
</rule>
<rule name="Joomla Search Rule" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="^/search.php" ignoreCase="true" />
</conditions>
<action type="Rewrite" url="/index.php?option=com_content&view=article&id=4" />
</rule>
<rule name="Joomla Main Rewrite Rule" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="(/[^.]*|\.(php|html?|feed|pdf|raw))$" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/" />
</rule>
</rules>
</rewrite>
<caching>
<profiles>
<add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" />
</profiles>
</caching>
</system.webServer>
</configuration>
This is a known bug of IIS7 and there is a hotfix for it, but I am in a hosted environment without privileges to install hotfixes. Here's a link to the Microsoft support website with detailed explanation and the resolution for the issue: FIX: A PHP application that depends on the REQUEST_URI server variable may fail when a request whose URL contains UTF-8 characters is sent to IIS 7.5
But if you can't install the hotfix, here's a workaround to get Joomla's SEF urls work with unicode:
The documentation says php's $_SERVER['REQUEST_URI'] doesn't work with unicode url rewriting, but I figured out that parameters work perfectly. We can send the url as a parameter to the php code and assign it to $_SERVER['REQUEST_URI']
Change your second rewrite rule in web.config file as follows:
<rule name="Joomla! Rule 2">
<match url="(.*)" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{URL}" pattern="^/index.php" negate="true" />
<add input="{URL}" pattern="/component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?requesturi={URL}" />
</rule>
The only change is modifying the url attribute of the <action> tag
In your index.php (located at the root directory of your Joomla site), add this at the top (just after the <?php opening tag)
$_SERVER['REQUEST_URI'] = $_GET['requesturi'];
Done. You have unicode in your beautified urls.
I having trouble getting iisnode to run my node application.
My directory structure is
iis-site
-client
-server
-server.js
How can I get iisnode to point to a nested .js file? I tried this, but it servers the server.js instead of executing it.
<handlers>
<add name="iisnode" path="server\server.js" verb="*" modules="iisnode" />
</handlers>
and
<rule name="default">
<match url="/*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="server/server.js" />
</rule>
I ended up posting this as an issue on the GitHub project and got an answer there.
Basically, the approach is to keep a .js file in the root of the directory that requires the .js that bootstraps your application.
Ex:
<handlers>
<add name="iisnode" path="iisnode.js" verb="*" modules="iisnode" />
</handlers>
and
<rule name="default">
<match url="/*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="iisnode.js" />
</rule>
and in iisnode.js there is one line of code: require(__dirname + '\\server\\server.js');
I struggled it with a bit and here is my solution without any additional file
Handler
<handlers>
<add name="iisnode" path="dist/index.js" verb="*" modules="iisnode"/>
<!-- Remote debugging (Azure Website with git deploy): Uncomment NtvsDebugProxy handler below.
Additionally copy Microsoft.NodejsTools.WebRole to 'bin' from the Remote Debug Proxy folder.-->
<!--<add name="NtvsDebugProxy" path="ntvs-debug-proxy/7afabecd-23d0-4ac1-a682-c36ef59e1480" verb="*" resourceType="Unspecified"
type="Microsoft.NodejsTools.Debugger.WebSocketProxy, Microsoft.NodejsTools.WebRole"/>-->
</handlers>
Rewite rule
<rewrite>
<rules>
<clear/>
<!-- Remote debugging (Azure Website with git deploy): Uncomment the NtvsDebugProxy rule below. -->
<!--<rule name="NtvsDebugProxy" enabled="true" stopProcessing="true">
<match url="^ntvs-debug-proxy/.*"/>
</rule>-->
<rule name="app" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
<match url="iisnode.+" negate="true"/>
<conditions logicalGrouping="MatchAll" trackAllCaptures="false"/>
<action type="Rewrite" url="dist/index.js"/>
</rule>
</rules>
So as you can see my app entry point is in dist/index.js
Gabor
I'm deploying a web application as an Azure Cloud Service.
The Cloud Service config specifies endpoints for both HTTP & HTTPS.
All the relevant CSCFG & CSDEF Cert stuff is configured correctly and the cert deployed and this all works.
I'd now like to add a HTTP->HTTPS rewrite rule to force any calls to HTTP to get redirected to the secure site.
I have a web.production.config transform on my web.config which adds the following block.
(Taken from http://blog.smarx.com/posts/redirecting-to-https-in-windows-azure-two-methods )
<system.webServer>
<rewrite xdt:Transform="Insert">
<rules>
<rule name="RedirectToHTTPS">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<add input="{URL}" pattern="/$" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="SeeOther" />
</rule>
</rules>
</rewrite>
</system.webServer>
This results in the following <system.webServer> section in the deployed config file.
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="DotLess" preCondition="integratedMode" type="dotless.Core.LessCssHttpHandler,dotless.Core" path="*.LESS" verb="*" />
</handlers>
<rewrite>
<rules>
<rule name="RedirectToHTTPS">
<match url="(.*)"/>
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true"/>
<add input="{URL}" pattern="/$" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
</conditions>
<action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="SeeOther"/>
</rule>
</rules>
</rewrite>
</system.webServer>
When I launch the site and browse to any of the urls (http or https, cloudapp.net or customdomain), I get an 500.19 error.
From googling, this would seem to indicate that the URLRewrite module isn't turned on, but everything I've read says that it's on by default for Cloud Service Applications.
In addition, I've scoured the log files. I can see the 500 errors in the BLOB Storage, wad-iis-logfiles container. But can't find anything else in any of the event logs under table storage. The service is configured to be dumping the most verbose Application Event & Diagnostic logging information.
Is there anyway to figure out the exact error for the 500.19 page, or any pointers based on the above for what might be going wrong ?
I finally figured out the issue.
I was using an xdt:insert on the transform, and because of the build & deploy process, it was actually running the Transformation twice, resulting in 2 rewrite sections appearing in the deployed web.config.
The solution was to add an empty
<system.webServer>
<rewrite />
</system.webServer>
To the template config file, and perform an xdt:Replace instead.
I was able to debug it by enabling the RDP settings on the publish deployment and then examing the Event Log, IIS Config & Web.Config on the actual instance.
I'm building a simple PHP web service using Azure Web Sites and I'm having trouble getting it to support PUT and DELETE http methods. Assuming it's something that'll have to go into the web.config file - I've tried a few options from around the interwebs but non of them seem to function properly. Any ideas?
Here's the web.config file as it currently stands:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
</handlers>
<security>
</security>
<directoryBrowse enabled="false" />
<caching>
<profiles>
<add extension=".php" policy="DontCache" kernelCachePolicy="DontCache" />
<add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00" />
</profiles>
</caching>
<rewrite>
<rules>
<rule name="block favicon" stopProcessing="true">
<match url="favicon\.ico" />
<action type="CustomResponse" statusCode="404" subStatusCode="1"
statusReason="The requested file favicon.ico was not found"
statusDescription="The requested file favicon.ico was not found" />
</rule>
<rule name="Cols Rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<remove value="index.php" />
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
I do not see that you have handler added into your web.config. I haven't personally tested but someone suggested that PUT and DELETE should work with Windows Azure Website however you would need to configure them correctly on your Windows Azure Websites through web.config.
Following is the simple configuration you can use to set it up:
<configuration>
<system.webServer>
<handlers>
<remove name="PHP53_via_FastCGI" />
<add name="PHP53_via_FastCGI" path="*.php"
verb="GET, PUT, POST, HEAD, DELETE"
modules="FastCgiModule"
scriptProcessor="D:\Program Files (x86)\PHP\v5.3\php-cgi.exe"
resourceType="Either" requireAccess="Script" />
</handlers>
</system.webServer>
</configuration>
It didn't work with DELETE as the last option, and here's the code modified for PHP54 on Azure. But thanks to Avkash!
<handlers>
<remove name="PHP54_via_FastCGI" />
<add name="PHP54_via_FastCGI" path="*.php"
verb="GET, PUT, POST, DELETE, HEAD"
modules="FastCgiModule"
scriptProcessor="D:\Program Files (x86)\PHP\v5.4\php-cgi.exe"
resourceType="Either" requireAccess="Script" />
</handlers>