Azure Scheduler Management Client Library
The `azure-mgmt-scheduler` library is the Microsoft Azure Scheduler Management Client Library for Python. It provides programmatic access to manage Azure Scheduler resources. While the library's current version is 7.0.0, the underlying Azure Scheduler service has been retired by Microsoft. This package received security fixes until January 31, 2022, and is no longer actively maintained for new features or non-security bug fixes.
Warnings
- breaking The underlying Azure Scheduler service has been retired by Microsoft as of January 31, 2022. This library is no longer maintained for new features or non-security bug fixes.
- breaking Authentication methods changed significantly in version 7.0.0. Older `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported. The `credentials` parameter was renamed to `credential`.
- gotcha Attempting to create, update, or retrieve Azure Scheduler resources using this library will almost certainly result in API errors (e.g., HTTP 404 Not Found, 410 Gone) because the backend service is no longer available.
- breaking In version 7.0.0, operations that previously returned a `msrest.polling.LROPoller` now return an `azure.core.polling.LROPoller` and are prefixed with `begin_`. The exceptions tree has been simplified, and most exceptions are now `azure.core.exceptions.HttpResponseError` (CloudError has been removed).
Install
-
pip install azure-mgmt-scheduler
Imports
- SchedulerManagementClient
from azure.mgmt.scheduler import SchedulerManagementClient
Quickstart
from azure.identity import DefaultAzureCredential
from azure.mgmt.scheduler import SchedulerManagementClient
import os
# Your Azure subscription ID (get it from environment variable or replace directly)
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "YOUR_SUBSCRIPTION_ID")
# Authenticate with Azure (DefaultAzureCredential tries multiple authentication methods)
# Ensure AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET (for service principal)
# or AZURE_USERNAME, AZURE_PASSWORD (for developer login) are set as environment variables
# or use other credential types from azure.identity.
credential = DefaultAzureCredential()
# Create the Scheduler management client
try:
scheduler_client = SchedulerManagementClient(credential, subscription_id)
print(f"SchedulerManagementClient created for subscription: {subscription_id}")
print("\nWARNING: The Azure Scheduler service has been retired as of January 31, 2022.")
print("Any operations attempted with this client (e.g., listing job collections) will likely fail.")
# Example: Attempt to list job collections (this will likely fail)
# for collection in scheduler_client.job_collections.list_by_subscription():
# print(f"Job Collection: {collection.name}")
except Exception as e:
print(f"Error creating or using SchedulerManagementClient: {e}")
print("This is expected behavior as the underlying service is retired.")