Import rpyc not working in azure web service python flask application

241 views Asked by At

1)Import rpyc not working in azure web service python flask application, Its shows "Application Error If you are the application administrator, you can access the diagnostic resources."

2)How to insall rpyc in azure app service with flask application?

Please help

1

There are 1 answers

10
Mohit Verma On BEST ANSWER

Here is something what you can do:

  • Create requirement.txt file with all your dependent libraries, simple declaration would be in your txt file like below:

    beautifulsoup4  ==4.8.1
    bs4             ==0.0.1
    Click           ==7.0
    cycler          ==0.10.0
    django-cors     ==0.1
    Flask           ==1.1.1

  • Create .venv file under your root folder with below values:

    FLASK_APP=StartupFile.py
    FLASK_ENV=development

  • Once you deployed the solution , open the KUDU app of your azure portal:

enter image description here

  • You can open the BASH and browse the directory which would be wwwroot:

enter image description here

  • Execute the command in below order:

   python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    export FLASK_APP=application.py
    flask run

Similarly your module will be installed in the virtual environment. Add the dependency in your requirement.txt.

Additional reference:

https://jackstromberg.com/2018/07/installing-python-wheel-files-on-an-azure-app-service/

Hope it helps.