I am trying to deploy an Azure ML webservice endpoint to an app service. I prefer to use an app service instead of ACI or AKS endpoints, because an app service has the benefit of scaling and deploying SSL certificates, withouth having to maintain and setup a fully secured AKS cluster. ACI is not advised to use in a production environment.
The docker image I am trying to deploy is the same docker image produced with ACI or AKS deployment. To do so I ran 'az model deploy' command for an ACI endpoint, which builds and packages all resources needed for the endpoint into an Docker image stored in ACR. I set up an app service which pulls this docker image from an ACR. Copying the startup command runsvdir /var/runit
and azureml environment variables from a working ACI example should give an working webservice endpoint as app service. Unfortunately, I am struggling with an error that the azureml-app directory could not be found, which contains the model, model code and model execution scripts.
2021-03-05T08:38:53.803756130Z 2021-03-05T08:38:53,786438768+00:00 - gunicorn/run
2021-03-05T08:38:53.806168222Z ./run: line 13: cd: /var/azureml-app: No such file or directory
Pulling the docker image from the ACR and inspecting manually indeed confirmed there is no /var/azureml-app directory. But connecting to the ACI and inspecting the running container has a directory /var/azureml-app. For me it's not clear when this folder and data is pulled into the image/container. I would expect during 'az ml deploy' command which builds tjhe docker image, but clearly this is not the case. This is the only thing preventing me from having a working app service, does anyone have an idea how to solve this?
More info about the docker image build by AzureML Docker Image AzureML