Registry / azure / azure-cli-sql

azure-cli-sql

JSON →
library2.2.5pypypiunverified

Microsoft Azure CLI SQL command module for managing Azure SQL databases, servers, and elastic pools. Current version 2.2.5. Released alongside Azure CLI core; no independent release cadence.

pip install azure-cli-sql
INSTALL
IMPORT
SIG · AZURE-CLI-SQL
A
azure-cli-sql
azurepythonv2.2.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SqlCommandsLoader
from azure.cli.command_modules.sql import SqlCommandsLoader
from azure.cli.command_modules.sql import SqlCommandsLoader

Initialize CLI and list SQL servers using the SQL command module. Requires prior `az login`.

from azure.cli.core import get_default_cli from azure.cli.command_modules.sql import SqlCommandsLoader cli = get_default_cli() loader = SqlCommandsLoader(cli) # List SQL servers (requires authenticated CLI session) result = cli.invoke(['sql', 'server', 'list']) print(result.result)
az --version
Debug
Known issues
breakingThe SQL module no longer supports the older SQL DB create/update parameters from versions < 2.0.0. Use `--capacity` and `--edition` instead of `--max-size-bytes` and `--sku-name`.
fix
Update scripts to use new parameter names: `az sql db create --capacity ... --edition ...`
affects: >=2.0.0
deprecatedAzure SQL Managed Instance commands using `az sql mi` are being deprecated in favor of the new `az sql mi` command group in the "mssql" extension. This module will eventually drop Managed Instance support.
fix
Install the mssql extension: `az extension add --name mssql` and use `az mssql mi` instead.
affects: >=2.2.0
gotchaModule import fails if Azure CLI is not fully installed. Running `pip install azure-cli-sql` alone will not pull all dependencies; you must also install `azure-cli` or `azure-cli-core`.
fix
Install full CLI: `pip install azure-cli` or at least `pip install azure-cli-core`.
affects: all
Upgrade
Version history
2.2.5latest on PyPI · released Jun 18, 2019
Audit
Dependencies
azure-cli-corerequiredRequired for CLI framework and authentication.
azure-mgmt-sqlrequiredPython SDK for Azure SQL management APIs.
Agent activity
34 hits · last 30 days
node
30
OpenAI (training)
1
Resources
azure-cli-sql — pip install azure-cli-sql · libregistry