Azure App Service – Options Method (and other HTTPS Verb) disabled / not working in Azure Web App


A customer deployed a SignalR API to WebApp. For this particular customer their environment is hosted on Azure App Service using App Service Environment v2. That said, I have reproduced the following behavior on the regular Windows-IIS based Azure Web App.

This SignalR API worked great on local machine, local dev server, and even Azure VM. However when deployed to Azure Web App, one of the API URIs wasn't responding as it should, as developer depends on some return parameters through HTTP Options method, we need to make this work.

When working as intended, using Postman, we should be seeing the following respond

What success should look like. This was hosted on a Windows 2012 R2 VM's IIS

Note that in the example above we are calling the Http verb - Options, basically exposing to the clients what options are available from the service; in this case "WebSockets", "ServerSentEvents", and "LongPolling".

As the application was uploaded to Azure App Service as an API, calling it from Postman, gave us this error message: "the resource you are looking for has been removed, had its name changed, or is temporarily unavailable - HTTP 401". Since this is not 404 error, we are quite sure the resource we are looking for is there, but not responding to our HTTP request.

After some digging around, it turns out that on Azure Web App, Options method is being disabled by default. We eventually added the following lines in one of our Web.config files to allow it.

<configuration>
 <system.webServer
  <security>
   <requestFiltering>
    <verbs allowUnlisted="true">
     <add verb="OPTIONS" allowed="true" />
    </verbs>
   </requestFiltering>
  </security>
 </system.webServer>
</configuration>

Unfortunately, I wasn't able to find any official documentation on this behavior, and if you do please let me know at the comment section!


Comments (0)

Skip to main content
The information in this weblog is provided “AS IS” with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the author’s discretion. All code samples are provided “AS IS” without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The inclusion of any link does not imply endorsement by Microsoft of the linked site.