Web application using torchvision

Hello everyone,
I would like to create a REST API for the creation of a web application.
The file that makes me the prediction algorithm is called main.py and includes all the necessary libraries like torchvision. I would like to publish this file on a server hosting and call it externally to get the result. I tried to use azure app service but I do not install the necessary libraries. How can I do it?