Azure NetApp Files Management Client Library for Python

15.0.0 · active · verified Thu Apr 09

The `azure-mgmt-netapp` library provides Python APIs for managing Azure NetApp Files resources, including NetApp accounts, capacity pools, and volumes. It allows developers to programmatically interact with the Azure NetApp Files service to automate provisioning, configuration, and monitoring of high-performance file storage. Currently at version 15.0.0, the library is part of the Azure SDK for Python, which follows a continuous release cadence, with regular updates to support new Azure features and improvements.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and list existing Azure NetApp Files accounts in your subscription. Ensure the necessary environment variables (`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`) are set for authentication.

import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.netapp import NetAppManagementClient

# Set environment variables for authentication and subscription ID
# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID

subscription_id = os.getenv("AZURE_SUBSCRIPTION_ID", "")
if not subscription_id:
    raise ValueError("AZURE_SUBSCRIPTION_ID environment variable not set.")

# Authenticate and create a client
credential = DefaultAzureCredential()
client = NetAppManagementClient(credential=credential, subscription_id=subscription_id)

# Example: List NetApp accounts in your subscription
print("Listing NetApp accounts:")
for account in client.accounts.list():
    print(f"  Account Name: {account.name}, Location: {account.location}")

view raw JSON →