Install & Compatibility
Where this runs
tested against v1.61.0.post4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 2.462s · 236.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 16.5s · import 2.304s · 238MB
256MB installed
● package 256MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Workspace
✓ from azureml.core import Workspace
Environment
✓ from azureml.core import Environment
Model
✓ from azureml.core import Model
Image
✓ from azureml.core import Image
✗ from azureml.core import Image
The `Image` class for deploying web service endpoints is deprecated. Use the `Environment` class instead for defining images.
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.
import os
from azureml.core import Workspace
# Recommended: Store workspace configuration in a .azureml/config.json file
# This allows Workspace.from_config() to load details automatically.
# Example config.json:
# {
# "subscription_id": "YOUR_SUBSCRIPTION_ID",
# "resource_group": "YOUR_RESOURCE_GROUP_NAME",
# "workspace_name": "YOUR_WORKSPACE_NAME"
# }
try:
# Attempt to load workspace from local config file
ws = Workspace.from_config()
print(f"Workspace loaded from config: {ws.name}")
except Exception as e:
print(f"Could not load workspace from config: {e}. Attempting direct connection...")
# Fallback: Connect directly using environment variables or hardcoded values (not recommended for production)
subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')
resource_group = os.environ.get('AZURE_RESOURCE_GROUP', 'YOUR_RESOURCE_GROUP_NAME')
workspace_name = os.environ.get('AZURE_WORKSPACE_NAME', 'YOUR_WORKSPACE_NAME')
if 'YOUR_' in subscription_id or 'YOUR_' in resource_group or 'YOUR_' in workspace_name:
print("Please provide valid Azure subscription, resource group, and workspace details.")
else:
try:
ws = Workspace(subscription_id=subscription_id,
resource_group=resource_group,
workspace_name=workspace_name)
print(f"Workspace connected: {ws.name}")
except Exception as auth_e:
print(f"Failed to connect to workspace with provided credentials: {auth_e}")
print("Ensure you are authenticated (e.g., via `az login`) and have correct details.")
# Example: Accessing workspace properties
if 'ws' in locals() and ws is not None:
print(f"Workspace Name: {ws.name}")
print(f"Azure Region: {ws.location}")
print(f"Default Datastore Name: {ws.get_default_datastore().name}")
az --version
Debug
Known issues
breakingThe `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.fixPlan migration to `azure-ai-ml` (SDK v2). Do not install both v1 and v2 SDKs in the same environment.
affects: >=1.0.0 (all v1 versions)
gotchaThe 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.fixUse separate Python environments for projects utilizing SDK v1 and SDK v2. For new projects, prefer SDK v2.
affects: All versions
breakingPython 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.fixEnsure your environment uses Python 3.8 or newer, as specified by the `requires_python` metadata (`<4.0, >=3.8`).
affects: <1.54.0 (for 3.7, earlier for 3.6)
deprecatedThe `Image` class in `azureml.core` for deploying web service endpoints is deprecated.fixUse the `Environment` class for defining and managing images for deployment instead of the `Image` class.
affects: All versions
gotchaManaging complex Python package dependencies within `Environment` objects can lead to long image build times and potential version conflicts.fixMicrosoft 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.
affects: All versions
gotchaHardcoding credentials or relying solely on interactive login for automated workflows can lead to security risks and operational issues.fixFor 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.
affects: All versions
gotchaDependency 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.fixWhen 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.
affects: All versions, particularly when using Designer or older pipeline definitions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'azureml' (or submodules like 'azureml.train' or 'azureml.api')
This error occurs when the 'azureml-core' package or a specific optional component is not installed in the Python environment, or the environment where the code is executing does not have access to the installed packages. For submodules like 'azureml.train' or 'azureml.api', it can also indicate an outdated SDK version or a module that has been refactored or removed in newer releases.
fixEnsure `azureml-core` is installed in your environment. If using optional features or specific modules, install the relevant extra packages, e.g., `pip install azureml-core` and potentially `pip install azureml-sdk[automl]` or `pip install azureml-sdk[train]`. Always work within an activated Python environment.
UserErrorException: We could not find config.json in: C:\Users\... or in its parent directories. Please provide the full path to the config file or ensure that config.json exists in the parent directories.
The `Workspace.from_config()` method, when called without a specified path, searches for the `config.json` file in the current directory, the `.azureml/` subdirectory, and parent directories. This error means the file was not found in any of these default locations.
fixEither place the `config.json` file (downloadable from your Azure ML workspace in the portal) in the current working directory or a `.azureml/` subdirectory, or provide the explicit path to the file: `ws = Workspace.from_config(path='path/to/config.json')`. Alternatively, authenticate explicitly: `ws = Workspace(subscription_id='<sub-id>', resource_group='<resource-group>', workspace_name='<workspace-name>')`.
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXXXXXXXX to authenticate.
This message appears in non-interactive environments (like scripts, pipelines, or containers) when `azureml-core` attempts to perform interactive browser-based authentication, which is not supported in such contexts.
fixUse a non-interactive authentication method. For pipelines or automated scripts, consider `ServicePrincipalAuthentication` with client ID, tenant ID, and client secret, or `MsiAuthentication` for managed identities if running on an Azure VM or compute target with MSI enabled. For local CLI-driven workflows, ensure you are logged in via `az login` and then use `AzureCliAuthentication`.
'Estimator' is deprecated. Please use 'ScriptRunConfig' from 'azureml.core.script_run_config' with your own defined environment or an Azure ML curated environment. OR FutureWarning: azureml.core: AzureML support for Python 3.6 is deprecated and will be dropped in an upcoming release. ... To disable SDK V1 deprecation warning set the environment variable AZUREML_DEPRECATE_WARNING to 'False'
These are deprecation warnings indicating that certain components or supported Python versions of `azureml-core` (SDK v1) are being phased out. The library itself is deprecated, and these messages encourage users to adopt newer patterns or migrate to SDK v2 (`azure-ai-ml`).
fixFor new development, migrate to the Azure Machine Learning Python SDK v2 (`azure-ai-ml`). For existing SDK v1 code, update deprecated classes like `Estimator` to `ScriptRunConfig`. Ensure your Python environment uses a supported version (Python 3.7 or newer is recommended). While you can suppress the warning with the environment variable `AZUREML_DEPRECATE_WARNING = 'False'`, migration is the recommended long-term solution.
Upgrade
Version history
1.61.0.post4latest on PyPI · released Jun 16, 2026
Audit
Dependencies
pythonrequiredRuntime environment