Azure CLI AppService Command Module

raw JSON →
0.2.21 verified Sat May 09 auth: no python

Microsoft Azure CLI extension for managing App Service resources like web apps, functions, and slots. Version 0.2.21 works with Azure CLI core. Releases follow Azure CLI releases (approx. monthly).

pip install azure-cli-appservice
error ImportError: cannot import name 'WebApp' from 'azure.cli.command_modules.appservice'
cause Attempting to import a model class that belongs to the management SDK, not the command module.
fix
Use from azure.mgmt.web import WebSiteManagementClient and access WebApp through the client.
error ModuleNotFoundError: No module named 'azure.cli.core'
cause Command module loaded directly without Azure CLI core installed.
fix
Install azure-cli-core: pip install azure-cli-core
gotcha This package is a command module for Azure CLI. It should not be used standalone; always install azure-cli or azure-cli-core first.
fix Install azure-cli-core alongside this package.
gotcha Importing symbols directly from azure.cli.command_modules.appservice is not supported for public use. The module is designed to be loaded by Azure CLI's command loader.
fix Use Azure CLI commands (e.g., `az webapp`) instead of direct imports.
deprecated Some commands may be deprecated in future releases. Check release notes for appservice-specific deprecations.
fix Run `az find "webapp"` or check Azure CLI release notes.
az extension add --name appservice

Verifies import of the command module loader. To use CLI commands, invoke via Azure CLI, not directly in Python.

from azure.cli.command_modules.appservice import AppServiceCommandsLoader
auth = os.environ.get('AZURE_AUTH_LOCATION', '')
print(f'AppServiceCommandsLoader imported (auth: {auth})')