Azure Web应用程序在创建后添加deploymentLocalGitUrl

标签 azure web-applications azure-web-app-service azure-cli

我正在尝试https://learn.microsoft.com/nl-nl/azure/app-service/app-service-web-get-started-html当然,我并没有严格按照要求行事。

我已经有一个网络应用程序(以及资源​​计划和其他东西)。我只是想添加本地 git 的东西。当我在 CLI 中列出应用程序的属性时,应该有这个属性 deploymentLocalGitUrl,但它不在那里。我如何通过 CLI 或仪表板添加它?

提前致谢。

干杯,埃里克!

最佳答案

gitdirectory=<Replace with path to local Git repo>
username=<Replace with desired deployment username>
password=<Replace with desired deployment password>

在azure上创建webapp后,配置网站以通过git进行部署。设置帐户级部署凭据。

$ az webapp deployment user set --user-name $username --password $password

此命令将返回要推送到的 Git 端点,其中包含用户名。

$ az webapp deployment source config-local-git --name mywebapp --resource-group myResourceGroup

返回结果如下:

{
  "url": "https://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ffafceafde1eee2eacfe2f6f8eaedeeffffa1fcece2a1eef5fafdeaf8eaedfce6fbeafca1e1eafb" rel="noreferrer noopener nofollow">[email protected]</a>/mywebapp.git"
}

掌握端点后,cd 到 git 存储库并在 Git 中设置一个名为 azure 的新远程。

$ cd $gitdirectory    //remember to git init before you cd

$ git remote add azure https://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="63161006110d020e06230e1a1406010213134d10000e4d0219161106140601100a1706104d0d0617" rel="noreferrer noopener nofollow">[email protected]</a>/mywebapp.git

最后,您可以将应用程序部署到 Azure。

git push azure master

您可以在门户中看到的属性如下: enter image description here

更多详情可以引用这个article还有这个one .

关于Azure Web应用程序在创建后添加deploymentLocalGitUrl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51032681/

相关文章:

azure - 我在哪里可以获得 Microsoft 管理的 key ?

c# - 什么是 XPS 文件及其使用方式

Azure 启动脚本未执行

c# - 添加数据库迁移代码时 Azure 应用服务崩溃

azure - NET Core应用程序无法访问Azure Key Vault

c# - 我的服务应如何响应 Azure 负载均衡器探测?

java - GWT - 如何异步发送表单?

javascript - 如何将网络应用程序添加到用户主屏幕?

azure - 将此消息发送到您的机器人时出错 : HTTP status code NotFound error in test in web chat

Azure 队列 - 我可以验证消息只会被读取一次吗?