Registry /
azure / azure-mgmt-kubernetesconfiguration
Install & Compatibility
Where this runs
tested against v3.1.0 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 33.8MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.0s · import 0.000s · 34MB
33MB installed
● package 33MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
KubernetesConfigurationClient
✓ from azure.mgmt.kubernetesconfiguration import KubernetesConfigurationClient
✗ from azure.mgmt.kubernetesconfiguration import KubernetesConfigurationClient
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and instantiate the `KubernetesConfigurationClient`. It then lists all available operations for Kubernetes Configuration, which serves as a basic connectivity and permission test. Ensure your `AZURE_SUBSCRIPTION_ID` environment variable is set or replace the placeholder, and you are authenticated to Azure (e.g., via `az login`).
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.kubernetesconfiguration import KubernetesConfigurationClient
# Set your Azure Subscription ID as an environment variable (AZURE_SUBSCRIPTION_ID)
# or replace os.environ.get with your actual subscription ID string.
subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')
if not subscription_id or subscription_id == 'YOUR_SUBSCRIPTION_ID':
raise ValueError(
"Please set the AZURE_SUBSCRIPTION_ID environment variable or replace 'YOUR_SUBSCRIPTION_ID'."
)
# Authenticate using DefaultAzureCredential.
# This will try several authentication methods, including Azure CLI, Azure Developer CLI,
# environment variables, and Managed Identity if applicable.
credential = DefaultAzureCredential()
# Create a KubernetesConfigurationClient instance
client = KubernetesConfigurationClient(credential, subscription_id)
print(f"Listing operations for Kubernetes Configuration in subscription {subscription_id}:")
try:
# List all available operations related to Kubernetes Configuration.
# This is a common and safe way to test client connectivity and permissions without
# requiring specific resource names.
operations = client.operations.list()
# Iterate and print basic details of each operation
for op in operations:
print(f"- {op.display.provider}/{op.display.resource}: {op.display.operation}")
print("Quickstart example completed successfully.")
except Exception as e:
print(f"An error occurred: {e}")
print("Please ensure your subscription ID is correct and you have appropriate permissions.")
Debug
Known issues
breakingMajor version updates (e.g., from 2.x to 3.x) often introduce breaking changes due to underlying Azure API version changes or significant SDK design updates. Client constructors, method signatures, and model schemas can change.fixAlways review the official Azure SDK for Python changelog and migration guides for `azure-mgmt-kubernetesconfiguration` when upgrading. Update your code to reflect any new client instantiation patterns, method parameters, or data model changes.
affects: <3.0.0 to 3.x.x
gotcha`DefaultAzureCredential` might fail to find credentials if environment variables (like `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`) are not set, or if you are not logged in via Azure CLI/VS Code.fixEnsure you are authenticated to Azure (`az login` via Azure CLI is a common method) or that the necessary `AZURE_`-prefixed environment variables are correctly configured for service principal authentication. Consult the `azure-identity` documentation for credential precedence details.
affects: All versions using `azure-identity`
gotchaResource-specific operations often require precise `cluster_rp`, `cluster_resource_name`, and `cluster_name` parameters. `cluster_rp` (Resource Provider) can be confusing and specific to the Kubernetes distribution (e.g., 'Microsoft.ContainerService' for AKS, 'Microsoft.Kubernetes' for Arc-enabled clusters).fixRefer to the Azure REST API documentation for the specific Kubernetes resource type you are managing to correctly identify the required parameters and their exact values. Verify the resource type's `cluster_rp` and associated resource names carefully.
affects: All versions
Upgrade
Version history
3.1.0latest on PyPI · released Sep 22, 2023
Audit
Dependencies
azure-identityrequiredRequired for authentication with Azure services using modern credential types like DefaultAzureCredential.
azure-corerequiredFundamental shared utilities for all Azure SDKs, including HTTP pipelines and error handling.
azure-mgmt-corerequiredShared utilities and base classes for Azure management SDKs, providing common functionality.