Hello Sena and Alex,
Thanks for sharing the solution, will escalate this issue to document team to see how to doc this fine. If Sena feels Alex's answer is helpful, please kindly accept it so that more people can see.
I will repo Sena's answer here for Sena's convenience to accept since the question poster can not accept her/his own answer as some limitation.
Thanks again for reporting the issue and posting the solution.
For private workspace, you only need to run these codes once. There is no need to run these codes everytime when creating an environment.
#set compute cluster for environment job
from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential
subscription_id = "<subscription id>"
resource_group = "<resource group>"
workspace = "<workspace name>"
ml_client = MLClient(
DefaultAzureCredential(), subscription_id, resource_group, workspace
)
# Get workspace info
ws=ml_client.workspaces.get(name=workspace)
# Update to use cpu-cluster for image builds
ws.image_build_compute="<compute cluster name>"
# To switch back to using ACR to build (if ACR is not in the VNet):
# ws.image_build_compute = ''
ml_client.workspaces.begin_update(ws)
#set legacy mode of the workspace to False
Python
from azureml.core import Workspace
ws = Workspace.from_config()
ws.update(v1_legacy_mode=False)
Appreciated again.
Regards,
Yutong
-Please kindly accept the answer if you feel helpful to support the community, thanks a lot.