针对 Azure 应用服务的 CLI 示例CLI samples for Azure App Service

下表包含指向使用 Azure CLI 生成的 bash 脚本的链接。The following table includes links to bash scripts built using the Azure CLI.

创建应用Create app
创建应用并使用 FTP 部署文件Create an app and deploy files with FTP 创建应用服务应用并使用 FTP 将文件部署到该应用。Creates an App Service app and deploys a file to it using FTP.
创建应用并从 GitHub 部署代码Create an app and deploy code from GitHub 创建应用服务应用并从公共 GitHub 存储库部署代码。Creates an App Service app and deploys code from a public GitHub repository.
从 GitHub 使用连续部署创建应用Create an app with continuous deployment from GitHub 创建应用服务应用并从你拥有的 GitHub 存储库持续向其发布代码。Creates an App Service app with continuous publishing from a GitHub repository you own.
从本地 Git 存储库创建应用并部署代码Create an app and deploy code from a local Git repository 创建应用服务应用并配置从本地 Git 存储库进行的代码推送。Creates an App Service app and configures code push from a local Git repository.
创建应用并将代码部署到过渡环境Create an app and deploy code to a staging environment 创建应用服务应用并为其配置用于暂存代码更改的部署槽位。Creates an App Service app with a deployment slot for staging code changes.
配置应用Configure app
将自定义域映射到应用Map a custom domain to an app 创建应用服务应用并将自定义域名映射到它。Creates an App Service app and maps a custom domain name to it.
将自定义 SSL 证书绑定到应用Bind a custom SSL certificate to an app 创建应用服务应用并将自定义域名的 SSL 证书绑定到它。Creates an App Service app and binds the SSL certificate of a custom domain name to it.
缩放应用Scale app
手动缩放应用Scale an app manually 创建应用服务应用并将其在 2 个实例之间进行缩放。Creates an App Service app and scales it across 2 instances.
缩放具有高可用性体系结构的全球应用Scale an app worldwide with a high-availability architecture 在两个不同地理区域中创建两个应用服务应用,并使用 Azure 流量管理器通过单个终结点使其可用。Creates two App Service apps in two different geographical regions and makes them available through a single endpoint using Azure Traffic Manager.
将应用连接到资源Connect app to resources
将应用连接到 SQL 数据库Connect an app to a SQL Database 创建应用服务应用和 SQL 数据库,然后将数据库连接字符串添加到应用设置。Creates an App Service app and a SQL database, then adds the database connection string to the app settings.
将应用连接到存储帐户Connect an app to a storage account 创建应用服务应用和存储帐户,然后将存储连接字符串添加到应用设置。Creates an App Service app and a storage account, then adds the storage connection string to the app settings.
将应用连接到用于 Redis 的 Azure 缓存Connect an app to an Azure Cache for Redis 创建应用服务应用和用于 Redis 的 Azure 缓存,然后将 Redis 连接详细信息添加到应用设置。)Creates an App Service app and an Azure Cache for Redis, then adds the redis connection details to the app settings.)
将应用连接到 Cosmos DBConnect an app to Cosmos DB 创建应用服务应用和 Cosmos DB,然后将 Cosmos DB 连接详细信息添加到应用设置。Creates an App Service app and a Cosmos DB, then adds the Cosmos DB connection details to the app settings.
备份和还原应用Back up and restore app
备份应用Back up an app 创建应用服务应用,并为其创建一次性备份。Creates an App Service app and creates a one-time backup for it.
为应用创建计划备份Create a scheduled backup for an app 创建应用服务应用,并为其创建计划的备份。Creates an App Service app and creates a scheduled backup for it.
从备份中还原应用Restores an app from a backup 从备份中还原应用服务应用。Restores an App Service app from a backup.
监视应用Monitor app
使用 Web 服务器日志监视应用Monitor an app with web server logs 创建应用服务应用,为其启用日志记录,并将日志下载到本地计算机。Creates an App Service app, enables logging for it, and downloads the logs to your local machine.