我想使用 git 和 Powershell 编写 Azure 网站创建和部署的脚本。
通过 cmdlet,我可以创建网站并更改托管计划模式。 但我不知道如何使用 powershell cmdlet 编写 Azure 网站的“从源代码管理设置部署”网站操作脚本。
- 是否有可用的 cmdlet 来执行此类操作?
- 我可以在哪一个文档中找到文档?
最佳答案
如果您只想在网站上启用 git 存储库,请使用以下命令:
new-azurewebsite mynewwebsite -git
如果您想启用 github 集成,那么您可以使用如下内容:
$creds = Get-Credential
new-azurewebsite mynewwebsite -github -githubrepository youraccount/yourreponame -githubcredentials $creds
在这两种情况下,您都应该位于要创建存储库本地副本的目录中,并确保 git.exe 位于路径中。
关于git - Azure 'Set up deployment from source control' 通过 Powershell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25884882/