Web app stops working after adding a new environmental variable.

Steven Davey 0 Reputation points
2024-09-27T05:44:38.7866667+00:00

I have a python web app deployed on a linux machine. In the Azure Portal, for this web app I set a new environmental variable. It is not referenced in the code and does not conflict with any of the azure names. Once I save the new environmental variable, the app page shows an Application Error. The diagnostic report says "Resource not found". The "self-diagnostics" do not pick up any issues (all tests complete and show a green tick).

The app was working fine before the variable was added. Stopping and restarting the app does not fix the issue. Restarting the app does not fix the issue. I have to do a full redeploy to fix the issue

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

1 answer

Sort by: Most helpful
  1. Laxman Reddy Revuri 720 Reputation points Microsoft Vendor
    2024-10-03T17:01:06.8566667+00:00

    Hi@ Steven Davey - Thanks for the question and using MS Q&A platform.
    Please consider exploring these options to help resolve the issue with adding a new environmental variable.

    Ensure that there are no formatting mistakes in the name and value of the environment variable.

    In the Monitoring section, open Log stream to check real-time logs for errors.

    Make sure all your application dependencies are up to date. Sometimes outdated libraries can lead to unexpected errors.

    Ensure that the variable is correctly set in the environment where your app is running.

    Add the variable in a staging environment first or temporarily remove it to see if the app functions correctly again.

    Confirm that the new variable is being set correctly. Sometimes, issues arise if the variable is set in a scope that doesn’t apply to the running application (like a different environment or configuration).

    I hope this information is helpful.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it.

    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.