首页  >  文章  >  后端开发  >  如何在 Azure 应用服务上部署具有 CI/CD 管道的 Web 应用。

如何在 Azure 应用服务上部署具有 CI/CD 管道的 Web 应用。

王林
王林原创
2024-08-09 09:25:52914浏览

使用 GitHub 和 Visual Studio Code 在 Azure 应用服务上部署具有持续集成/持续部署 (CI/CD) 管道的 Web 应用程序涉及几个步骤,我将在下面讨论:

1。设置您的 Azure 帐户并创建 Web 应用程序:

  • 登录 Azure 门户:使用 https://portal.azure.com
  • 创建应用服务计划:
  1. 从主页搜索应用服务计划,如下图所示。 How to deploy a Web App with CI/CD pipeline on Azure app service.
  2. 单击“创建”。 How to deploy a Web App with CI/CD pipeline on Azure app service.
  3. 填写所需的详细信息(订阅、资源组、名称、操作系统、区域等)。 How to deploy a Web App with CI/CD pipeline on Azure app service.
  4. 选择您喜欢的定价计划。然后单击“查看+创建”。 How to deploy a Web App with CI/CD pipeline on Azure app service.
  5. 单击“创建”。 How to deploy a Web App with CI/CD pipeline on Azure app service.
  6. 单击“转到资源”。 How to deploy a Web App with CI/CD pipeline on Azure app service.
  7. 点击 webapp-plan。 How to deploy a Web App with CI/CD pipeline on Azure app service. How to deploy a Web App with CI/CD pipeline on Azure app service.
  8. 搜索并单击网络应用程序来创建一个。 How to deploy a Web App with CI/CD pipeline on Azure app service. How to deploy a Web App with CI/CD pipeline on Azure app service. 填写所需的详细信息(订阅、资源组、Web 应用程序名称、发布、运行时堆栈等)。 How to deploy a Web App with CI/CD pipeline on Azure app service. 审查+创建。 How to deploy a Web App with CI/CD pipeline on Azure app service. How to deploy a Web App with CI/CD pipeline on Azure app service. How to deploy a Web App with CI/CD pipeline on Azure app service.

2。设置您的本地开发环境:
如果尚未安装 Visual Studio Code 和 Git,请安装。
3.在 Visual Studio Code 中初始化 Git 存储库并创建 Web 应用程序:
打开 Git 并通过单击“新建存储库”创建一个新存储库。
How to deploy a Web App with CI/CD pipeline on Azure app service.
How to deploy a Web App with CI/CD pipeline on Azure app service.
How to deploy a Web App with CI/CD pipeline on Azure app service.

  1. 从 Visual Studio 代码终端初始化 Git: How to deploy a Web App with CI/CD pipeline on Azure app service. How to deploy a Web App with CI/CD pipeline on Azure app service. 运行 git init 来初始化 Git 存储库。 运行 git add 。暂存您的文件。 运行 git status How to deploy a Web App with CI/CD pipeline on Azure app service. 运行 git clone +url (从之前创建的存储库) How to deploy a Web App with CI/CD pipeline on Azure app service. 运行纳米索引 php 运行cat索引php How to deploy a Web App with CI/CD pipeline on Azure app service.

5。返回我们的 Azure 页面:
转到 Azure 门户中的 Web 应用程序。
在“部署”部分中,选择“部署中心”。
How to deploy a Web App with CI/CD pipeline on Azure app service.
选择代码源。点击Github
How to deploy a Web App with CI/CD pipeline on Azure app service.
How to deploy a Web App with CI/CD pipeline on Azure app service.
How to deploy a Web App with CI/CD pipeline on Azure app service.
How to deploy a Web App with CI/CD pipeline on Azure app service.
6.部署应用程序
提交并推送:提交更改并将其推送到 GitHub。 GitHub Actions 工作流程将自动启动、构建您的应用程序并将其部署到 Azure 应用服务。
需要从免费订阅升级才能进行部署,如下所示:
How to deploy a Web App with CI/CD pipeline on Azure app service.
升级后,您现在可以添加插槽了。
How to deploy a Web App with CI/CD pipeline on Azure app service.
How to deploy a Web App with CI/CD pipeline on Azure app service.
How to deploy a Web App with CI/CD pipeline on Azure app service.

7。监控部署
检查部署状态:您可以在 GitHub 上的“操作”选项卡中监控部署进度。
查看 Web 应用程序:部署后,您的 Web 应用程序应该可以通过 Azure 应用服务 URL 访问。

How to deploy a Web App with CI/CD pipeline on Azure app service.
How to deploy a Web App with CI/CD pipeline on Azure app service.

通过执行这些步骤,您将在 Azure 应用服务上使用 GitHub 和 Visual Studio Code 成功部署具有 CI/CD 管道的 Web 应用程序。

以上是如何在 Azure 应用服务上部署具有 CI/CD 管道的 Web 应用。的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn