Search code examples
pythonazuredeploymentazureportalazure-machine-learning-service

How can I troubleshoot my Azure ML service deployment?


I am trying out Azure Machine Learning Service to deploy a ML model as web service.

I have already registered a model and now would like to deploy it as web service following the guide using Azure (Python) Notebooks.

The step

 service = Webservice.deploy_from_model(my-model-svc',
                                   deployment_config=aciconfig,
                                   models=[model],
                                   image_config=image_config)

fails for me with

Creating image
Image creation operation finished for image my-model-svc:5, operation "Succeeded" Creating service
Running.
FailedACI service creation operation finished, operation
"Failed" Service creation polling reached terminal state, current service state: Transitioning Service creation polling reached terminal state, unexpected response received.

Not sure about what could be the root cause, as (AFAIK) I have no ways to access logs of the deployment in Azure portal.

Can someone shed some light on this?


Solution

  • I think that your init function is failing. I would first try to isolate the image creation from the image deployment, and just test the image first:

    • Create the image first, it's very much ok if do it through the interface
    • Pull the image locally with Docker (for this you'll need Docker and the Azure CLI installed):
    az acr login -n <container-registry>
    docker run -p 8000:5001  <container-registry>.azurecr.io/<image-name>:<image-version>
    # basically, the entire image location, see pic below
    
    • test the image locally, it listens on the 8000 port:
    POST http://localhost:8000/score
    Content-Type: application/json
    
    • if this works deploy it on ACI

    <container-registry> is the name of the Container Registry associated with the ML Workspace, you can also extract it from the image location, taking care to remove everything after the first dot:

    image location