How to solve the "Stopping site because it is not healthy" when deploying ml model into an Azure Function?

Juan Ponce de Leon 1 Reputation point
2021-03-19T01:11:17.48+00:00

Hello there!
While trying to complete following tutorial I faced following issue:
"Stopping site mymlfunction because it is not healthy."

Below the complete log lines I see:

"
2021-03-18T23:25:12.553Z INFO - Logging is not enabled for this container. Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2021-03-18T23:25:17.915Z INFO - Initiating warmup request to container mymlfunction_0_216cb03b for site mymlfunction
2021-03-18T23:25:33.337Z INFO - Waiting for response to warmup request for container mymlfunction_0_216cb03b. Elapsed time = 15.4220545 sec
2021-03-18T23:25:45.612Z INFO - Container mymlfunction_0_216cb03b for site mymlfunction initialized successfully and is ready to serve requests.
2021-03-18T23:25:45.614Z INFO - Initiating warmup request to container mymlfunction_0_216cb03b_middleware for site mymlfunction
2021-03-18T23:25:47.009Z INFO - Container mymlfunction_0_216cb03b_middleware for site mymlfunction initialized successfully and is ready to serve requests.
2021-03-18T23:25:52.051Z ERROR - Container for mymlfunction_0_216cb03b site mymlfunction is unhealthy, Stopping site.
2021-03-18T23:25:52.056Z INFO - Stopping site mymlfunction because it is not healthy.
"

When this happens, the system falls into a loop trying to initialize the Azure Function but fails since due to the error above just right after saying that the container was successfully deployed.

I was able to complete the majority of the tutorial until the last step which configures the Azure Function to use my ACR user and password but still seeing same issue, see last step of the tutorial in link below:

https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-ml#deploy-image-as-a-web-app

The container to be deployed was build from Azure ML workspace using following python script:

"
from azureml.contrib.functions import package
from azureml.contrib.functions import HTTP_TRIGGER
from azureml.core import Workspace
from azureml.core.model import Model

ws = Workspace.from_config()
model = Model(ws, 'sklearn_mnist')

model_package = package(ws, [model], inference_config, functions_enabled=True, trigger=HTTP_TRIGGER)
model_package.wait_for_creation(show_output=True)

Display the package location/ACR path

print(model_package.location)
"

Can somebody help me resolve this issue?

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,311 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,872 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ramr-msft 17,826 Reputation points
    2021-03-19T12:38:01.353+00:00

    @Juan Ponce de Leon Thanks for the question. Can you please share the full log details. The deployment of a ML model to Azure Functions is in preview. The ability to package model (aka containerize the model) via Azure ML and deploying to Azure Functions, you can enable app insights, model telemetry etc. to check the full log details.
    Here is the doc:
    https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-functions


  2. Michał Grochecki 1 Reputation point
    2021-08-09T13:23:48.96+00:00

    Hi guys, any luck with this issue? I'm facing the same error when trying to follow this tutorial https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-functions on how to deploy ML models to Functions.

    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.