Share via

Python code deployment using Azureml and swaggee json

Abhishek Rao 1 Reputation point
2021-06-05T04:57:18.11+00:00

Hii..I am trying to deploy a model built in python using azureml-model-management-sdk package and then writing to swagger json. The python function - the model simply takes 2 inputs and give an output.
Both the inputs are string and can contain special characters like ', " / etc. Have added the handling of such special characters in the python code itself using re. But when the inputs contain these characters in the deployment setup it gives an error saying http 400 bad request. Is there a way to allow single and double quotes in the json directly to rectify this issue. Have searched all over the internet but haven't found a solution for the same. Please help.

Azure Machine Learning
0 comments No comments

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,836 Reputation points
    2021-06-07T08:49:56.923+00:00

    @Abhishek Rao Thanks for the question. Can you please share the score.py to check the schema and If you've enabled an OpenAPI(Swagger) specification for your deployment, you can use tools such as swagger-codegen to create client libraries for your service.
    Please follow the samples to consume an Azure Machine Learning model deployed as a web service.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.