The `azure-mgmt-servicefabric` library is the Microsoft Azure Service Fabric Management Client Library for Python. It allows developers to programmatically manage Azure Service Fabric resources, such as clusters, applications, and services. The current stable version is 2.1.0, released on December 18, 2023. As part of the broader Azure SDK for Python, it follows a frequent release cadence, with updates often aligning with new features and fixes across Azure services.
pip install azure-mgmt-servicefabric azure-identityVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and instantiate the `ServiceFabricManagementClient`. It then shows how to list Service Fabric clusters within a specified resource group. Ensure relevant Azure environment variables for authentication and subscription ID are set.
Migrate authentication to use classes from `azure-identity` (e.g., `DefaultAzureCredential`) and update client instantiation to use the `credential` parameter. Review the migration guide for the Azure SDK for Python if upgrading from very old versions.
Update import statements to `from azure.mgmt.servicefabric import ServiceFabricManagementClient` and `from azure.mgmt.servicefabric.models import MyClass`.
Upgrade to Python 3.7 or higher. The current version requires Python >=3.7.
Ensure you are using the correct management library based on your Service Fabric cluster type. If managing Service Fabric Managed Clusters, install and use `azure-mgmt-servicefabricmanagedclusters`.
When deploying or configuring Service Fabric clusters, ensure that the durability tier is set to Silver or Gold for production environments. This often implies a minimum number of VMs (e.g., 5 or more for Silver/Gold).
Ensure your environment is correctly configured for `DefaultAzureCredential`. This typically involves setting `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and `AZURE_CLIENT_SECRET` (or `AZURE_CLIENT_CERTIFICATE_PATH`) environment variables for a service principal, or logging in via Azure CLI (`az login`), or ensuring a Managed Identity is available when running in Azure hosting environments. For detailed troubleshooting, refer to the `azure-identity` documentation (https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot).
Ensure the required Azure environment variables are correctly set for your chosen authentication method (e.g., service principal credentials). For local development, consider authenticating via `az login` (Azure CLI) or configuring Visual Studio Code. Refer to the Azure Identity documentation for Python for detailed setup and troubleshooting: `https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot`.