Cannot load json file in azure websites

Anonymous
2023-11-13T14:39:15.4266667+00:00

In Dev environment I am able to read the file Employees.json but in

https://mets.azurewebsites.net/

Here is the source code

https://github.com/KalyanAllam/BurnedCalories/

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
0 comments No comments
{count} votes

Answer accepted by question author
  1. AgaveJoe 1,510 Reputation points
    2023-11-13T18:40:53.09+00:00

    According to the error message in the browser's dev tools the Employee.json file was not found. That means the path is wrong or the file does not exist in the application root. Have you checked if the file exists in production?

    GET https://mets.azurewebsites.net/Employees.json 404 (Not Found)
    

    If you are Visual Studio to publish the app, click on the file in solution explorer and set the "Copy to Output Directory" to "Copy Always"

    Capture

    Otherwise, simply copy the file to the application root.


0 additional answers

Sort by: Most helpful

Your answer

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