from mlflow.deployments import get_deploy_client
# Set the tracking URI as the deployment client
client = get_deploy_client(mlflow.get_tracking_uri())
# Set the model path
model_path = "model"
# Define the model path and the name as the service name
# The model is registered automatically and a name is autogenerated by using the "name" parameter
client.create_deployment(name="mlflow-test-aci", model_uri='runs:/{}/{}'.format(run.id, model_path))
from mlflow.deployments import get_deploy_client
# Set the tracking URI as the deployment client
client = get_deploy_client(mlflow.get_tracking_uri())
# Set the model path
model_path = "model"
# Set the deployment config json file
deploy_path = "deployment_config.json"
test_config = {'deploy-config-file': deploy_path}
# Define the model path and the name as the service name
# The model is registered automatically and a name is autogenerated by using the "name" parameter
client.create_deployment(model_uri='runs:/{}/{}'.format(run.id, model_path), config=test_config, name="mlflow-test-aci")