diff --git a/sdk/ml/azure-ai-ml/CHANGELOG.md b/sdk/ml/azure-ai-ml/CHANGELOG.md index edd8ea1f8005..074c71ee389d 100644 --- a/sdk/ml/azure-ai-ml/CHANGELOG.md +++ b/sdk/ml/azure-ai-ml/CHANGELOG.md @@ -12,6 +12,7 @@ ### Bugs Fixed - MLClient.from_config can now find the default config.json on Compute Instance when running sample notebooks. - Adjust registry experimental tags and imports to avoid warning printouts for unrelated operations. +- Prevent registering an already existing environment that references conda file. ### Other Changes diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py index d5d5c4c6a8f0..aeff4fb29284 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py @@ -232,6 +232,7 @@ def _from_rest_object(cls, env_rest_object: EnvironmentVersionData) -> "Environm if rest_env_version.conda_file: translated_conda_file = yaml.safe_load(rest_env_version.conda_file) environment.conda_file = translated_conda_file + environment._translated_conda_file = rest_env_version.conda_file return environment