如何将appsettings.json设置包含到Azure DevOps构建和发布管道中 [英] How to include appsettings.json settings into Azure DevOps build and release pipeline

查看:190
本文介绍了如何将appsettings.json设置包含到Azure DevOps构建和发布管道中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在研究Azure DevOps Build和Release管道的用法.

We are currently researching the usage of Azure DevOps Build and Release pipelines.

我们确实成功创建了一个简单的Asp.NET Core Web应用程序,并将该应用程序推送到Azure DevOps存储库中.

We did successfully create a simple Asp.NET Core web application and pushed that application into an Azure DevOps repository.

我们确实为该应用程序成功创建了一个管道,该管道包括还原",构建",测试",发布"和发布工件"(如附图所示),并成功构建了该管道.

We did successfully create a pipeline for that application consisting of Restore, Build, Test, Publish, and Publish Artifacts (as shown on the attached image) and successfully built that pipeline.

在Azure门户中,我们确实成功创建了资源组和Web应用程序以托管Web应用程序

In the Azure Portal, we did successfully create a Resource Group and the Web App to host the web application

在Azure DevOps中,我们确实为该应用程序成功创建了一个发行版,并且已成功地将该应用程序发布到了创建的Web应用程序中

In the Azure DevOps, we did successfully create a release for that application and did successfully publish the application to the created Web App

但是,在Azure门户的新创建的Web App配置部分中,没有从应用程序的appsettings.json传输的配置值.

However, in the Azure Portal, in the newly created Web App configuration section, there are no config values transferred from the application's appsettings.json.

我确实尝试在管道的发布"部分上使用链接设置"功能,但这没用

I did try to use 'Link settings' feature on the Publish segment of the pipeline, but that didn't work

因此,问题是如何通过Azure DevOps管道将ASP.NET Core Web应用程序的配置值传输到Azure Portal Web应用程序并发布?

Thus, the question is how do I transfer the config values of the ASP.NET Core Web application into an Azure Portal Web App through an Azure DevOps pipeline and release?

推荐答案

我们找到了解决方案

在管道上单击加号(添加新任务),然后选择"Azure App Service设置"

Click plus sign on the pipeline (add new task) and choose 'Azure App Service Settings'

在任务"的应用程序设置"上,添加所需的设置

On the App Settings for the Task, add the settings you need

保存,构建并添加到发行版

Save, build and add to the release

这篇关于如何将appsettings.json设置包含到Azure DevOps构建和发布管道中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆