{"id":3899,"library":"azure-mgmt-hanaonazure","title":"Azure Management SAP Hana on Azure","description":"The `azure-mgmt-hanaonazure` library is the Microsoft Azure SAP Hana on Azure Management Client Library for Python. Its current stable version is 1.0.0, released in April 2021. This library is part of the older generation of Azure SDKs and has been officially deprecated, with support for the underlying older SDK guidelines ending. Developers are advised to migrate to the newer Azure SDK management libraries for continued support and updates.","status":"deprecated","version":"1.0.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/hanaonazure/azure-mgmt-hanaonazure","tags":["azure","management","sap","hana","cloud","deprecated"],"install":[{"cmd":"pip install azure-mgmt-hanaonazure azure-identity","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for modern Azure Active Directory token authentication with DefaultAzureCredential.","package":"azure-identity","optional":false},{"reason":"Provides core functionalities like HTTP pipeline, error handling, and polling, typically a transitive dependency.","package":"azure-core","optional":false}],"imports":[{"note":"As of v1.0.0, the client cannot be imported from the sub-module; import directly from the package root.","wrong":"from azure.mgmt.hanaonazure.hana_management_client import HanaManagementClient","symbol":"HanaManagementClient","correct":"from azure.mgmt.hanaonazure import HanaManagementClient"},{"symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.hanaonazure import HanaManagementClient\n\n# Set your Azure Subscription ID as an environment variable or replace directly\nSUBSCRIPTION_ID = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"your-subscription-id\")\n\nif SUBSCRIPTION_ID == \"your-subscription-id\":\n    print(\"Please set the AZURE_SUBSCRIPTION_ID environment variable or replace 'your-subscription-id'.\")\n    exit(1)\n\n# Authenticate with Azure. DefaultAzureCredential attempts several common authentication methods.\ncredential = DefaultAzureCredential()\n\n# Create a client for SAP Hana on Azure Management\nclient = HanaManagementClient(credential, SUBSCRIPTION_ID)\n\nprint(f\"Listing SAP HANA on Azure operations for subscription: {SUBSCRIPTION_ID}\")\n\n# Example: List available operations (a common pattern for management clients)\n# Note: Specific resource listing methods may vary, this is a generic example.\n# If there are no specific 'list' methods on the client root, one might need to access\n# sub-clients like client.operations.list() or client.hana_instances.list()\n\ntry:\n    # Assuming there's a list method for operations or a top-level resource.\n    # The exact method will depend on the API definition for HanaOnAzure.\n    # For demonstration, we'll try a common pattern. If it fails, actual usage\n    # requires consulting the specific service's API reference.\n    # As per docs, 'operations' is a common attribute for listing supported ops.\n    for operation in client.operations.list():\n        print(f\"Operation: {operation.name} - {operation.display.provider}/{operation.display.resource}/{operation.display.operation}\")\nexcept AttributeError:\n    print(\"Client does not have a 'operations.list()' method. Please consult the API reference for available resource management methods, e.g., for listing HANA instances.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and initialize the `HanaManagementClient`. It then attempts to list available operations, which is a common pattern for Azure management clients to verify connectivity and access."},"warnings":[{"fix":"Migrate to the equivalent service in the latest Azure SDK for Python. Consult Azure SDK documentation for the replacement package (e.g., `azure-resourcemanager` for Java, implying a similar shift for Python).","message":"This library (`azure-mgmt-hanaonazure`) is officially deprecated. Microsoft recommends migrating to newer Azure SDK management libraries for ongoing support, security updates, and new features.","severity":"breaking","affected_versions":"All versions, as it's part of an older SDK generation."},{"fix":"Replace old credential classes with `azure-identity` (e.g., `DefaultAzureCredential`) and ensure the client constructor uses the `credential` parameter.","message":"The credential system was completely revamped. `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported. Use `azure-identity` classes (e.g., `DefaultAzureCredential`). The `credentials` parameter has been renamed to `credential`.","severity":"breaking","affected_versions":"1.0.0b1 and later (stable 1.0.0 is affected)."},{"fix":"Update method calls to use the `begin_` prefix for long-running operations and expect `azure.core.polling.LROPoller` for polling results.","message":"Operations that previously returned `msrest.polling.LROPoller` now return `azure.core.polling.LROPoller` and are prefixed with `begin_` (e.g., `create_or_update` becomes `begin_create_or_update`).","severity":"breaking","affected_versions":"1.0.0b1 and later (stable 1.0.0 is affected)."},{"fix":"Adjust import statements to import `HanaManagementClient` directly from `azure.mgmt.hanaonazure`.","message":"The `HanaManagementClient` class cannot be imported from `azure.mgmt.hanaonazure.hana_management_client`. It must be imported directly from the package root: `from azure.mgmt.hanaonazure import HanaManagementClient`.","severity":"breaking","affected_versions":"1.0.0b1 and later (stable 1.0.0 is affected)."},{"fix":"Pass client configuration settings as keyword arguments during the client's `__init__` call, referring to `azure-core` documentation for supported options.","message":"The `config` attribute no longer exists on client objects. Configuration should be passed as keyword arguments during client instantiation (e.g., `MyClient(credential, subscription_id, enable_logging=True)`).","severity":"breaking","affected_versions":"1.0.0b1 and later (stable 1.0.0 is affected)."},{"fix":"Update exception handling blocks to catch `azure.core.exceptions.HttpResponseError` instead of `CloudError` or other older, specific exceptions.","message":"The exception hierarchy has been simplified. Most exceptions are now `azure.core.exceptions.HttpResponseError`. `CloudError` has been removed.","severity":"breaking","affected_versions":"1.0.0b1 and later (stable 1.0.0 is affected)."},{"fix":"For new projects, use the recommended newer Azure SDKs. For existing projects, consider testing thoroughly with newer Python versions or sticking to Python 3.8 or older for this specific library.","message":"The `azure-mgmt-hanaonazure` package was explicitly tested only up to Python 3.8. Using it with newer Python versions (e.g., 3.9+) might encounter unexpected compatibility issues, although it may still function.","severity":"gotcha","affected_versions":"Python 3.9 and newer when using this library."}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}