我正在通过源代码控制部署到 Microsoft Azure 网站。登录 Azure 门户并单击 UI 来查看部署历史记录是一件痛苦的事情。我们可以通过命令行或 PowerShell 管理部署吗?
最佳答案
是的,您可以使用 PowerShell 或 xplat(命令行)工具来执行此操作。
有关安装它们的更多信息请参见此处:
- http://azure.microsoft.com/en-us/documentation/articles/xplat-cli/
- http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/
对于 xplat 使用:
azure config mode 'asm'
site deployment list [options] [name]
site deployment show [options] <commitId> [name]
site deployment redeploy [options] <commitId> [name]
site deployment github [options] [name]
对于 PowerShell:
Get-AzureWebsiteDeployment [[-CommitId] <String>] [[-MaxResults] <Int32>] [-Details] [[-Name] <String>] [-Slot <String>] [<CommonParameters>]`
Get-AzureWebsiteDeployment -Name mySite
您还可以浏览到 https://{sitename}.scm.azurewebsites.net,在那里您还可以使用 REST api 查看您的部署。
关于azure-web-app-service - 从命令行或 PowerShell 查看部署历史记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26394810/