{"id":3420,"library":"azureml-core","title":"Azure Machine Learning Core SDK (v1)","description":"This package, part of the Azure Machine Learning Python SDK v1, provides core functionalities for interacting with Azure Machine Learning workspaces. It enables management of compute targets, experiments, runs, models, and environments. While it remains functional for existing workflows, it is officially deprecated as of March 2025 and will only receive security fixes until its end-of-support on June 30, 2026. Users are strongly encouraged to migrate to the Azure Machine Learning Python SDK v2 (`azure-ai-ml`).","status":"deprecated","version":"1.61.0.post3","language":"en","source_language":"en","source_url":"https://aka.ms/azureml-sdk-docs","tags":["azure","machine-learning","mlops","sdk","deprecated","cloud"],"install":[{"cmd":"pip install azureml-core","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Runtime environment","package":"python","version":"<4.0, >=3.8"}],"imports":[{"symbol":"Workspace","correct":"from azureml.core import Workspace"},{"symbol":"Environment","correct":"from azureml.core import Environment"},{"symbol":"Model","correct":"from azureml.core import Model"},{"note":"The `Image` class for deploying web service endpoints is deprecated. Use the `Environment` class instead for defining images.","wrong":"from azureml.core import Image","symbol":"Image","correct":"from azureml.core import Image"}],"quickstart":{"code":"import os\nfrom azureml.core import Workspace\n\n# Recommended: Store workspace configuration in a .azureml/config.json file\n# This allows Workspace.from_config() to load details automatically.\n# Example config.json:\n# {\n#    \"subscription_id\": \"YOUR_SUBSCRIPTION_ID\",\n#    \"resource_group\": \"YOUR_RESOURCE_GROUP_NAME\",\n#    \"workspace_name\": \"YOUR_WORKSPACE_NAME\"\n# }\n\ntry:\n    # Attempt to load workspace from local config file\n    ws = Workspace.from_config()\n    print(f\"Workspace loaded from config: {ws.name}\")\nexcept Exception as e:\n    print(f\"Could not load workspace from config: {e}. Attempting direct connection...\")\n    # Fallback: Connect directly using environment variables or hardcoded values (not recommended for production)\n    subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')\n    resource_group = os.environ.get('AZURE_RESOURCE_GROUP', 'YOUR_RESOURCE_GROUP_NAME')\n    workspace_name = os.environ.get('AZURE_WORKSPACE_NAME', 'YOUR_WORKSPACE_NAME')\n\n    if 'YOUR_' in subscription_id or 'YOUR_' in resource_group or 'YOUR_' in workspace_name:\n        print(\"Please provide valid Azure subscription, resource group, and workspace details.\")\n    else:\n        try:\n            ws = Workspace(subscription_id=subscription_id, \n                           resource_group=resource_group, \n                           workspace_name=workspace_name)\n            print(f\"Workspace connected: {ws.name}\")\n        except Exception as auth_e:\n            print(f\"Failed to connect to workspace with provided credentials: {auth_e}\")\n            print(\"Ensure you are authenticated (e.g., via `az login`) and have correct details.\")\n\n# Example: Accessing workspace properties\nif 'ws' in locals() and ws is not None:\n    print(f\"Workspace Name: {ws.name}\")\n    print(f\"Azure Region: {ws.location}\")\n    print(f\"Default Datastore Name: {ws.get_default_datastore().name}\")","lang":"python","description":"The quickstart demonstrates how to connect to an Azure Machine Learning Workspace. The recommended approach is to use `Workspace.from_config()` which reads details from a `config.json` file, or as a fallback, explicitly provide subscription, resource group, and workspace names. Ensure you are authenticated to Azure (e.g., via `az login`) for interactive login, or use service principal/MSI for automated workflows."},"warnings":[{"fix":"Plan migration to `azure-ai-ml` (SDK v2). Do not install both v1 and v2 SDKs in the same environment.","message":"The `azureml-core` package (Python SDK v1) is deprecated. Support for it will end on June 30, 2026. Microsoft recommends migrating to the new Azure Machine Learning Python SDK v2 (`azure-ai-ml`) before this date to ensure continued support and access to new features.","severity":"breaking","affected_versions":">=1.0.0 (all v1 versions)"},{"fix":"Use separate Python environments for projects utilizing SDK v1 and SDK v2. For new projects, prefer SDK v2.","message":"The Python SDK v1 (`azureml-core`) and Python SDK v2 (`azure-ai-ml`) are incompatible and should not be installed in the same environment, as this can cause clashes and confusion.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your environment uses Python 3.8 or newer, as specified by the `requires_python` metadata (`<4.0, >=3.8`).","message":"Python 3.7 reached end-of-life in June 2023. Support for Python 3.7 in `azureml-core` ended in February 2024. Python 3.6 support was deprecated earlier.","severity":"breaking","affected_versions":"<1.54.0 (for 3.7, earlier for 3.6)"},{"fix":"Use the `Environment` class for defining and managing images for deployment instead of the `Image` class.","message":"The `Image` class in `azureml.core` for deploying web service endpoints is deprecated.","severity":"deprecated","affected_versions":"All versions"},{"fix":"Microsoft recommends using custom Docker images and Dockerfiles (based on Azure ML base images) for managing Python environments, especially during iterative development, to provide full transparency and utilize Docker's caching for faster builds.","message":"Managing complex Python package dependencies within `Environment` objects can lead to long image build times and potential version conflicts.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For automated scenarios (e.g., CI/CD), use Service Principal or Managed Service Identity (MSI) authentication. Store credentials securely using environment variables or Azure Key Vault, rather than directly in code.","message":"Hardcoding credentials or relying solely on interactive login for automated workflows can lead to security risks and operational issues.","severity":"gotcha","affected_versions":"All versions"},{"fix":"When troubleshooting, verify that environment dependencies and SDK versions in your remote pipeline match those in your testing environment. If using Designer, be aware that managed environments might lag behind SDK updates.","message":"Dependency version mismatches between the pipeline runtime's `azureml-core` version and the expected SDK versions for pipeline components can cause `Failed to load entrypoint` errors in Azure ML Designer or pipelines.","severity":"gotcha","affected_versions":"All versions, particularly when using Designer or older pipeline definitions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}