如何在Azure DevOps发布管道中下载/检查转换后的配置文件

问题描述

在发布管道中,我有一个File Transform任务,可将多个变量插入我的app.config文件中。该任务成功完成,并且从日志中似乎所有变量都被替换了,但是我的测试失败了,我感到这是由于配置文件中的值错误。我想检查该配置文件以验证值,但无法弄清楚如何下载它。

在日志中,我有以下内容

2020-10-21T20:49:07.4398446Z ##[debug]Substituting original value in place of temp_name: CONfig_FILE_SETTINGS_TOKEN(ClientId)
2020-10-21T20:49:07.4399269Z ##[debug]Substituting original value in place of temp_name: CONfig_FILE_SETTINGS_TOKEN(ImpersonatedUserGuid)
2020-10-21T20:49:07.4400093Z ##[debug]Substituting original value in place of temp_name: CONfig_FILE_SETTINGS_TOKEN(AccountId)
2020-10-21T20:49:07.4400969Z ##[debug]Substituting original value in place of temp_name: CONfig_FILE_SETTINGS_TOKEN(PrivateKey)
2020-10-21T20:49:07.4404687Z ##[debug]Substituting original value in place of temp_name: CONfig_FILE_SETTINGS_TOKEN(Username)
2020-10-21T20:49:07.4405392Z ##[debug]Substituting original value in place of temp_name: CONfig_FILE_SETTINGS_TOKEN(Password)
2020-10-21T20:49:07.4406068Z ##[debug]Substituting original value in place of temp_name: CONfig_FILE_SETTINGS_TOKEN(tokenReplacementInSeconds)
2020-10-21T20:49:07.4406744Z Config file : D:\a\r1\a\testautomation\tests\NDS\bin\Release\net48\NDS.dll.config updated.
2020-10-21T20:49:07.4407872Z XML variable substitution applied successfully.
2020-10-21T20:49:07.4468956Z ##[section]Finishing: File Transform: app.config

从日志中,我试图确定如何下载已更新的文件D:\a\r1\a\testautomation\tests\NDS\bin\Release\net48\NDS.dll.config

有人知道我能做到这一点吗?甚至将文件内容打印到日志文件也足以让我进行验证。

解决方法

如果在发布管道中使用此选项,则可以移动任务以构建管道并将文件作为工件发布。那是一个选择。

另一个选项可以是Azure File Copy task,因此您可以将文件复制到Azure Blob,稍后再检查文件。

当然,您也可以从托管测试环境的地方获取文件。 (您没有提到它在哪里,所以我在这里不能多说)。

如果您有FTP可用,则可以在FTP Upload task那里复制文件。

如果仅将文件打印到输出,您的机密将被***替换,因此您可能无法根据需要进行验证。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...