Creating an API proxy for an Azure Static Web App Creating an API proxy for an Azure Static Web App flask flask

Creating an API proxy for an Azure Static Web App


According to your problem description, my understanding is that your backend program has been hosted online.

Now you want to allow Azure Static Web App to access this service. Suppose this service has an interface /MyTestController/TestConnection. You want the webapp program to pass, similar to http(s)://yourdomain.com/MyTestController/TestConnection or 167.2**.255.*2:8080/ MyTestController/TestConnection to access this interface, right?

Please use the following methods to troubleshoot and test.

Step 1.

Check the public network address on your backend server, because you are not sure where you are deployed, whether it is a LAN host or a third-party network service provider. You can check whether the host address where your service is located is on the public network or on the internal network.

If you are deploying on your own PC or LAN host, and get the intranet address, then this service cannot be accessed.

If you are deploying on a third-party cloud server or web service, you can open the specified port or service by setting relevant settings in the third-party server.

The specific details need to tell me how you deploy your backend program to better help you.

Step 2.

The simplest way to deal with it is to create a python webapp program in the Azure service and deploy your back-end service.

Of course, it is recommended that you troubleshoot the problem first. At present, your backend service public network should not be accessible, so you want to use proxy to handle it. Specific problems are analyzed in detail.

If you have not deployed the service to a third party, just deploy it on your own PC and other LAN hosts. As a test, you can use tools such as oray to try.