0

I have deployed a Model to an ACI container and have an endpoint that I can hit in Postman or using python SDK. I use Python to hit the endpoint as well as Postman and I get a response and the Container Instance logging records the event. I now what to use the AZ ML CLI to run the service and pass in some hardcoded JSON:

From the Azure ML CLI docs:

az ml service run --name (-n) --input-data (-d)

I run this

az ml service run -n "rj-aci-5" -d {\"input_df\": [{\"width\": 50, \"shoe_size\": 28}]}

There is no output or error. The logs do not record any invocation. Has anyone used the Azure CLI ML extensions to run a service in the manner above?

Rodney
  • 5,417
  • 7
  • 54
  • 98

1 Answers1

1

The az cli is likely failing to parse the provided data input. If I attempt to run the same command I see the following error:

az: error: unrecognized arguments: [{"width": 50, "shoe_size": 28}]}

You need to wrap the input in quotes for it to appropriately be taken as a single input parameter:

az ml service run -n "rj-aci-5" -d "{\"input_df\": [{\"width\": 50, \"shoe_size\": 28}]}"

trangevi
  • 355
  • 1
  • 7
  • Thanks. I have found the problem as to why I get no error code or response. When I run my commands above in a Powershell Terminal, it outputs nothing (I use Powershell to set variables for most of my CLI scripts. However, when I run it in a CMD terminal then it throws the error (or works once I run your version. I am using Visual Code so I switch terminals a lot.... very odd! – Rodney Oct 10 '19 at 00:46