git - Azure 'Set up deployment from source control' 通过 Powershell

标签 git powershell azure-web-app-service setup-deployment powershell-cmdlet

我想使用 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/

相关文章:

azure - 通过托管身份和私有(private)端点从 Azure WebApp 访问 Azure SQL

git - 在 AWS CodeBuild 中为 https git clone 设置凭证

git - 在代码审查期间使用 git 跟踪更改(存储与分支)

powershell - 使用PowerShell如何拆分选定属性的字符串

node.js - Azure Web 应用程序(Linux - Node v12 LTS)- 403 请求 header 太长

azure - Azure 保留网站的通配符 DNS A 记录

尽管 set-upstream-to 和 push.default,Git 仍推送 HEAD -> master

git - 我可以在 Gitlab 网络编辑器提交后触发 git hook 吗?

Powershell 计时器 - 更新 gui

powershell - 暂时将powershell语言更改为英语?