Search code examples
azure-devopsazure-pipelinesazure-pipelines-release-pipelineazure-pipelines-release-taskazure-pipelines-tasks

How to download/inspect a transformed config file in an Azure DevOps release pipeline


In my release pipeline I have a File Transform task to insert several variables into my app.config file. The task finishes successfully and from the log it appears that all variables were substituted however my tests are failing and I have a feeling it's due to a bad value in the config file. I want to inspect that config file to verify the values but can't figure out how to download it.

In the logs i have the following:

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

From the logs I'm trying to figure how to download the file D:\a\r1\a\testautomation\tests\NDS\bin\Release\net48\NDS.dll.config which has been updated.

Does anyone know how I could achieve this? Even printing the file content to the log file would be sufficient enough for me to verify.


Solution

  • If you use this in release pipeline you can move task to build pipeline and publish file as artifact. That's one option.

    Another option can be Azure File Copy task so you will copy your file to Azure Blob and later you can inspect your file.

    Of course, you can also get your file from a place where you host your test env. (you didn't mention where it is so I can't say here more).

    If you have FTP available you can copy your file there FTP Upload task.

    If you just print your file to the output your secrets will be replaced with *** so you may not be able to verify as you want to.