I'm trying to register a data bricks model tp Azure ML workspace with mlflow.azure.base_image model. But with this method, we can save the Azure ML image to default ACR connected to the Azure ML workspace.

But I want to save the Azure ML image to another existing ACR. Need help in figuring out the design.

The method I'm using is as follows

    workspace = Workspace.create(name = workspace_name,
                                 location = workspace_location,
                                 resource_group = resource_group,
                                 subscription_id = subscription_id,
                                 auth=svc_pr,
                                 exist_ok=True)

    import mlflow.azureml

    model_image, azure_model = mlflow.azureml.build_image(model_uri=model_uri, 
                                                          workspace=workspace,
                                                          model_name="winequality",
                                                          image_name="winequality",
                                                          description="Sklearn ElasticNet image for predicting wine quality",
                                                          synchronous=True)

    #model_image.wait_for_creation(show_output=True)
    print("Access the following URI for build logs: {}".format(model_image.image_build_log_uri))                                    
1

There are 1 answers

0
tonystark117 On

Attach existing ACR while creating Azure ML workspace and providing necessary permissions(contributor) role to service principal used.

workspace = Workspace.create(name = workspace_name,
                                 location = workspace_location,
                                 resource_group = resource_group,
                                 subscription_id = subscription_id,
                                 auth=svc_pr,
                                 container_registry=<resource_id>,
                                 exist_ok=True)
import mlflow.azureml

model_image, azure_model = mlflow.azureml.build_image(model_uri=model_uri, 
                                                      workspace=workspace,
                                                      model_name="winequality",
                                                      image_name="winequality",
                                                      description="Sklearn ElasticNet image for predicting wine quality",
                                                      synchronous=True)

#model_image.wait_for_creation(show_output=True)
print("Access the following URI for build logs: {}".format(model_image.image_build_log_uri))