Search code examples
azureazure-machine-learning-service

Accessing an Azure ML Model Registry from another Azure ML Workspace


Suppose I have two Azure ML workspaces:

  1. Workspace1 - This is being used by one team (Team1) who only train the model and store the model in model registry of Workspace1

  2. Workspace2 - This is used by another team (Team2) who containerise the model, push it to ACR and then deploy the containerised model in Azure ML Compute.

Is it possible for Team2 to access the model registry of Workspace1 from their Workspace2 and retrieve the model for containerisation and subsequent deployment? Alternatively, is there any concept of a shared model registry in Azure ML where both the teams can store and access a common model registry? If none of these are possible, then what is the way for Team1 and Team2 to work together on a single model with the given responsibilities as described above?


Solution

  • As described, I think the best solution is to use one Workspace, not two. It sounds like you have Team 1 and Team 2 sharing contributions on a single project. What may work better is to define user roles in the Azure ML workspace, such that Team 2 has permissions to deploy models, and Team 1 has permission to create models.

    Otherwise you can always write Python code using the ML SDK to connect to any workspace given you know the subscription, resource group, workspace name etc.

    from azure.core import Workspace, Model
    
    # connect to an existing workspace
    name = 'WorkspaceName'
    sub = 'subscriptionName'
    resource_group = 'resourceGroupName'
    ws = Workspace.get(name=name, subscription_id=sub, resource_group=resource_group) 
    
    # retrieve existing model
    model = Model(ws, name='your model name')