I'm building a REST API on Azure, but when I try to access an endpoint via the PUT method I get a HTTP 405 "Method Not Allowed"
status along with an IIS error message:
The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
How do I enable the PUT method, and other methods that may be blocked by default by Azure's default config settings?
I tried adding a web.config file to the root of my application with allowUnlisted set to true on the verbs element:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<verbs applyToWebDAV="false" allowUnlisted="true" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
This changed nothing.
I'm an open source guy, so the world of IIS is very unfamiliar to me. Any help is appreciated.
Thanks!
Add the following to the
web.config
in thesystem.webServer
element:This works for the built in versions of PHP, the current default is PHP 5.4, but if you have selected PHP 5.3 or PHP 5.5 you will need to modify the path of the php-cgi handler.