Azure 应用服务的 PowerShell 示例PowerShell samples for Azure App Service

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

创建应用Create app
从 GitHub 使用部署创建应用Create an app with deployment from GitHub 创建从 GitHub 提取代码的应用服务应用。Creates an App Service app that pulls code from GitHub.
从 GitHub 使用连续部署创建应用Create an app with continuous deployment from GitHub 创建从 GitHub 持续部署代码的应用服务应用。Creates an App Service app that continuously deploys code from GitHub.
使用 FTP 创建应用并部署代码Create an app and deploy code with FTP 使用 FTP 从本地目录创建应用服务应用并上传文件。Creates an App Service app and upload files from a local directory using FTP.
从本地 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.
备份和还原应用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.
删除应用的备份Delete a backup for an app 删除应用的现有备份。Deletes an existing backup for an app.
从备份中还原应用Restore an app from backup 从以前完成的备份中还原应用。Restores an app from a previously completed backup.
跨订阅还原备份Restore a backup across subscriptions 从另一订阅的备份中还原 Web 应用。Restores a web app from a backup in another subscription.
监视应用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.