1

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.

so cal cheesehead
  • 2,515
  • 4
  • 29
  • 50
  • Hi @so cal cheesehead, Just checking in to see whether this issue is still blocking you now? Any update for this issue? In addition, we could also print the .config file info with power shell script in the azure devops pipeline, then check the variable in the log. – Vito Liu Nov 02 '20 at 09:05
  • @VitoLiu-MSFT My best option I think is going to be to copy the file to an azure blob storage container however I'm running in what looks like permissions issue, from the Azure Blob File copy action: `RESPONSE Status: 403 This request is not authorized to perform this operation using this permission.` – so cal cheesehead Nov 05 '20 at 03:27

1 Answers1

2

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.

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107
  • 1
    Copying the file to an azure blob storage did the trick! FYI for anyone that may run into this, I was running into the error `403 This request is not authorized to perform this operation using this permission.` The container was getting created but then would error attempting to copy the file. I tried adding many different permission roles to no avail, what fixed it for me was using the AzureBlob File Copy task version `3.*` The latest version `4.*` would the exact same configuration was failing with the `403` error. – so cal cheesehead Nov 05 '20 at 18:22