Static Website hosted on Azure AppService not working properly

Luis Simoes 1 Reputation point
2021-02-04T12:07:26.217+00:00

Hi,

I have deployed a web app to a new Azure app service to support a set of static html files where I have javascript to receive get variables and perform some posts etc...
I have chose the .NET framework.

Currently I am receiving a 405 error and I presume its because *.html is not set to handle GET, POST methods?

Is this accurate?

How can I change this setting?

Thank you

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
966 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 18,451 Reputation points
    2021-02-05T00:09:52.167+00:00

    Hello @Luis Simoes ,

    Can you please share with us the documentation you are following? because based on this doc " The application exposes URLs like /counter and /fetchdata which map to specific routes of the application. Since this app is implemented as a single page application, each route is served the index.html file. To ensure that request for any path return index.html a fallback route is implemented in the routes.json file found in the wwwroot folder of the Client project."

    Please try the below configuration to ensure that requests to any route in the app returns the index.html page:

    {  
      "routes": [  
        {  
          "route": "/*",  
          "serve": "/index.html",  
          "statusCode": 200  
        }  
      ]  
    }  
    

    Please keep in mind that fallback route must be listed last in your routing rules, as it catches all requests not caught by previously defined rules.

    Hope that helps.

    Best,
    Grace

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.