{"id":27605,"library":"azure-cli-sql","title":"Azure CLI SQL Module","description":"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.","status":"active","version":"2.2.5","language":"python","source_language":"en","source_url":"https://github.com/Azure/azure-cli/tree/main/src/command_modules/azure-cli-sql","tags":["azure","sql","cli","microsoft","command-module"],"install":[{"cmd":"pip install azure-cli-sql","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for CLI framework and authentication.","package":"azure-cli-core","optional":false},{"reason":"Python SDK for Azure SQL management APIs.","package":"azure-mgmt-sql","optional":false}],"imports":[{"note":"SqlCommandsLoader is the top-level loader, not in custom.","wrong":"from azure.cli.command_modules.sql.custom import SqlCommandsLoader","symbol":"SqlCommandsLoader","correct":"from azure.cli.command_modules.sql import SqlCommandsLoader"}],"quickstart":{"code":"from azure.cli.core import get_default_cli\nfrom azure.cli.command_modules.sql import SqlCommandsLoader\n\ncli = get_default_cli()\nloader = SqlCommandsLoader(cli)\n# List SQL servers (requires authenticated CLI session)\nresult = cli.invoke(['sql', 'server', 'list'])\nprint(result.result)","lang":"python","description":"Initialize CLI and list SQL servers using the SQL command module. Requires prior `az login`."},"warnings":[{"fix":"Update scripts to use new parameter names: `az sql db create --capacity ... --edition ...`","message":"The 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`.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Install the mssql extension: `az extension add --name mssql` and use `az mssql mi` instead.","message":"Azure 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.","severity":"deprecated","affected_versions":">=2.2.0"},{"fix":"Install full CLI: `pip install azure-cli` or at least `pip install azure-cli-core`.","message":"Module 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`.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `pip install azure-cli` to install the full CLI.","cause":"Missing Azure CLI core package.","error":"ModuleNotFoundError: No module named 'azure.cli.core'"},{"fix":"Use `from azure.cli.command_modules.sql import SqlCommandsLoader` directly.","cause":"Using outdated import path; the loader may have moved.","error":"ImportError: cannot import name 'SqlCommandsLoader' from 'azure.cli.command_modules.sql'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}