The `azure-mgmt-maps` library provides Python client APIs for managing Azure Maps accounts and resources. It enables programmatic interaction with Azure Maps, allowing operations such as creating, updating, deleting, and listing Maps accounts, as well as managing account keys. The current stable version is 2.1.0, released in September 2023, and it follows the Azure SDK for Python's release cadence, with major versions indicating potential breaking changes.
pip install azure-mgmt-mapsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to authenticate with Azure, list existing Maps accounts, and create or update an Azure Maps account using the `azure-mgmt-maps` library. It uses `DefaultAzureCredential` for authentication, which is suitable for local development and production environments. Ensure you have an Azure subscription ID and an existing resource group.
Update your authentication logic to use classes from `azure.identity` (e.g., `DefaultAzureCredential`) and pass the credential object to the `credential` parameter of the `MapsManagementClient` constructor.
Review your code for method calls involving Maps accounts and update parameter names from `maps_account_id` to `account_id` and `maps_account` to `account` as appropriate.
Adjust LRO calls to use the `begin_` prefix and handle `azure.core.exceptions.HttpResponseError` for general API errors. Update any custom error handling logic.
If upgrading to `3.0.0b1` or later, consult the migration guide for hybrid models and adjust property access accordingly. It's recommended to stick to stable versions unless actively testing beta features.
Ensure the service principal or user identity being used has the necessary RBAC roles assigned on the subscription, resource group, or Maps account scope.
Always include a valid `sku` object (e.g., `{"name": "G2"}`) in your account creation or update payload.Adjust the import statement for the Maps management client. Verify the correct class name and its module path within the `azure-mgmt-maps` package for your installed version. For example, it might be necessary to import from a specific submodule or to use a different client class name if it was renamed.
Review the `azure-mgmt-maps` documentation or inspect the installed package structure (e.g., `site-packages/azure/mgmt/maps`) to determine the correct import path and class name for the management client in version 2.x, and update your import statement accordingly.