azure - 如何将 appsettings.json 设置包含到 Azure DevOps 构建和发布管道中

标签 azure asp.net-core azure-devops azure-pipelines

我们目前正在研究 Azure DevOps 构建和发布管道的使用。

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

我们确实成功地为该应用程序创建了一个管道,其中包括恢复、构建、测试、发布和发布工件(如附图所示),并成功构建了该管道。

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

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

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

我确实尝试在管道的发布部分使用“链接设置”功能,但这不起作用

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

enter image description here

最佳答案

我们找到了解决方案

单击管道上的加号(添加新任务)并选择“Azure 应用服务设置”

Azure App Service Settings

在任务的应用程序设置中,添加您需要的设置

App Settings

保存、构建并添加到版本

关于azure - 如何将 appsettings.json 设置包含到 Azure DevOps 构建和发布管道中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61238621/

相关文章:

c# - Windows Azure 角色内缓存异常问题

c# - 如何将因来源而异添加到 asp.net 选项 header

c# - ResponseCache 始终将 Cache-Control 设置为 no-cache, no-store in ASP.net core

azure-devops - 如何配置 Azure DevOps 发布管道以使用来自 Azure Artifacts 的通用包?

amazon-web-services - 将 Azure 管道变量作为类型 : Number 的参数传递给 AWS Cloudformation 模板

azure - 在 Azure 数据工厂上导出 XML

azure - 如何在Azure API管理Python SDK中使用过滤器

azure - 如何导出 datafactory v2 中的管道或迁移到另一个

asp.net-core - AspNetCore.SignalR 2.1和CORS

azure - 使用新的基于AAD的访问控制通过Web浏览器通过URI访问Blob文件