Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
382 stars 1.22k forks source link

`az ml folder attach` uses the AML SDK from the environment #1289

Open algattik opened 4 years ago

algattik commented 4 years ago

Extension name (the extension in question)

ml

Description of issue (in as much detail as possible)

az ml folder attach uses the AML SDK from the environment rather than the one bundled in the extension.

This can be demonstrating by blocking the .azureml folder by writing a file with that name, causing an exception to be raised by the command, which shows the script paths.

touch .azureml
az ml folder attach -w ws -g rg

ProjectSystemException:
        Message: Traceback (most recent call last):
  File "/Users/digdug/.pyenv/versions/3.7.6/envs/my-azureml/lib/python3.7/site-packages/azureml/_project/project_engine.py", line 51, in attach_project
    project_manager.attach_project(project_id, project_path, project_arm_scope, compute_target_dict)
  File "/Users/digdug/.pyenv/versions/3.7.6/envs/my-azureml/lib/python3.7/site-packages/azureml/_project/project_manager.py", line 104, in attach_project
    _base_project_contents_folder_name)
  File "/Users/digdug/.pyenv/versions/3.7.6/envs/my-azureml/lib/python3.7/site-packages/azureml/_project/project_manager.py", line 144, in _copy_default_files
    shutil.copy(orig_path, new_path)
  File "/Users/digdug/.pyenv/versions/3.7.6/lib/python3.7/shutil.py", line 248, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/Users/digdug/.pyenv/versions/3.7.6/lib/python3.7/shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
NotADirectoryError: [Errno 20] Not a directory: '/Users/digdug/sample/.azureml/conda_dependencies.yml'

yonzhan commented 4 years ago

ml