How to fix the issue - "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." for deployed react app. But the same code runs locally.

Rutika Khaire 0 Reputation points
2023-10-11T16:11:28.1966667+00:00

I have a react application that has a landing page with a chat UI. If I run it locally then the URL is like this http://localhost:4000 which takes me to the OIDC authentication and from API after successful authentication the react app url is called from callback by adding a token in the URL like this http://localhost:4000/?token=xyztoken. This works correctly when I test it locally but when I deploy this to Azure, after successful authentication when my App Service redirects to react app with token, I get the below error.

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

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

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 18,216 Reputation points
    2023-10-18T04:22:34.1766667+00:00

    Hello @Rutika Khaire , we are sorry to hear you're facing this issue. How did you deploy your React app( VS code, Azure portal,etc)?

    Also, did you setup any URL rewrite rules in your web.config file?

    Here are a few possible solutions that might help you resolve the issue:

    1. Add a startup command in app service configuration (if using Linux ): You can add the following command in the startup command in app service configuration:
    npm2 serve /home/site/wwwroot --no-daemon
    

    To do this, follow these steps:

    • Go to App Service.
    • Navigate to Configuration.
    • Click on General Settings.
    • Add the above command in Start up command and click on save.
    • Then restart the server.
    1. You can deploy your React app to Azure App Service using Visual Studio Code. Here are the steps:
    • Open your project in Visual Studio Code.
    • Go to Extensions and search for Azure App Service. Click on Install.
    • Go to Azure App Service and sign in to your Azure Account.
    • Select your Subscription
    • Click on Deploy to Web App.
    • Deploy your react app to Azure App Service

    User's image

    Hope that helps.

    -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.