英文:
How can I deploy react application on azure windows VM using azure devops release pipeline
问题
已成功创建了用于 React 应用程序的构建管道,但无法将构建产物部署到 Windows VM。是否有方法可以使用 Azure 发布管道在 Windows VM 上部署 React 构建?
想要创建发布管道以在 Azure Windows VM 上部署 React 构建。
英文:
I have created build pipeline successfully for react application but not able to deploy that build artifact on windows VM. Is there any way to deploy react build on windows VM using azure release pipeline ?
Want to create release pipeline to deploy react build on azure windows VM
答案1
得分: 0
我已尝试使用以下步骤进行复制,并取得了积极的结果。
步骤 1: 创建Azure虚拟机并在VM上安装Internet Information Services (IIS) Manager,如下所示,并进行验证。
安装IIS后,转到浏览器并输入localhost,您将看到下面的图像。
步骤 2: 转到Azure DevOps > 管道 > 部署组,创建一个新的部署组并复制PowerShell脚本。
注意:如果您未在脚本中启用“在脚本中使用个人访问令牌进行身份验证”,则必须手动创建并在VM上运行脚本时粘贴它。
步骤 3: 转到VM > PowerShell > 粘贴脚本并使用默认值运行。
成功在VM中运行脚本后,您将在Azure DevOps中看到VM处于在线状态。
步骤 4: 转到发布管道 > 单击新管道并选择IIS网站部署模板。
选择您在步骤2中创建的部署组。
上述截图中的物理路径是部署文件将放置的默认路径。如果您有其他自定义托管路径,您可以更改它。
确保您已为要部署的artefacts文件夹提供正确的路径。
步骤 5: 运行管道并检查输出。
英文:
I have tried to repro the same using the below steps and I got positive results.
Step 1: Create Azure Virtual Machine and Install Internet Information Services (IIS) Manager on VM as shown below and verify.
After installing the IIS, go to the browser and enter localhost, you will see the below image.
Step 2: Go to Azure DevOps > Pipelines > Deployment Groups to create a new
deployment group and copy the power shell script.
Note: If you do not enable the “Use a personal access token in the script for authentication”, You must create it manually and paste it while running the script in the VM.
Step 3: Go to VM > power shell > paste the script and run with default values.
Once you successfully run the script in the VM, you will see the VM is online in Azure DevOps.
Step 4: Go to Release pipelines > Click new pipeline and select IIS Website Deployment template.
Select the deployment group you have created in step 2.
The physical path in the above screenshot is the default path where the deployment files will fall. If you have any custom hosting path other than this you can change it.
Make sure you have given the right path for the a rtefacts folder to deploy.
Step 5: Run the pipeline and check the output.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论