The `azure-mgmt-sqlvirtualmachine` library provides a client for managing Azure SQL Virtual Machines, allowing you to create, update, delete, and list SQL VMs and their associated resources (like SQL VM groups and availability groups). It is currently at version `0.5.0` (as of late 2019) and follows the typical Azure SDK release cadence for management plane libraries, though updates for this specific library have been infrequent.
pip install azure-mgmt-sqlvirtualmachine azure-identityVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and list all SQL Virtual Machines within a specified subscription. Ensure the `AZURE_SUBSCRIPTION_ID` environment variable is set and your Azure principal has sufficient permissions (e.g., Reader role) to view resources.
Review the official Azure documentation for SQL Virtual Machines to understand current capabilities and consider if a newer API version or alternative tools (e.g., Azure CLI, REST API) are more appropriate for advanced or recently released features.
Ensure `azure-identity` is installed and that your environment variables (e.g., `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`) are set, or you are logged in via Azure CLI (`az login`). Verify the principal has the necessary RBAC permissions (e.g., 'Contributor' or specific resource roles) on the subscription or resource group.
Thoroughly review the Azure portal or CLI to confirm all dependent resources are present and correctly configured. Check resource names, IDs, locations, and network settings for accuracy before attempting to deploy or modify SQL Virtual Machines.