Flask App Deployment to Azure Web App using python 3.10

Sharma, Vasundhra 1 Reputation point
2024-08-27T11:22:48.9966667+00:00

Getting error below while deploying a flask app to azure web app.

2024-08-27T11:19:01.494Z ERROR - Container gainappservice05_1_4b085386_middleware for site gainappservice05 did not start within expected time limit. Elapsed time = 270.7352638 sec

2024-08-27T11:19:02.485Z ERROR - Container gainappservice05_1_4b085386 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.

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

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 18,451 Reputation points
    2024-09-04T22:37:20.7066667+00:00

    @Sharma, Vasundhra thanks for the updated information. The error message "ImportError: cannot import name 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE' from 'opentelemetry.sdk.environment_variables'" indicates that your code is trying to import a variable named OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE from the opentelemetry.sdk.environment_variables module, but this variable is not defined there.

    It's possible that the variable you're trying to import is a newer addition to the opentelemetry library. Try updating your opentelemetry library to the latest version using the following command:

    Bash

    pip install --upgrade opentelemetry
    
    • After updating, check the documentation for the latest version to see if the variable you need is now available.

    Also, since the error message suggests that the variable might be intended as an environment variable. You can set the environment variable OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE with the desired value before running your code. This can be done in several ways, such as:

    • Setting it in your terminal before running the script (refer to your terminal's documentation for specifics).
    • Defining it in a .env file and using a library like python-dotenv to load 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.