I am having an issue when I am attempting to use the “JSON Configuration Variables” feature.
I have this enabled and am using the below pattern as example
This issue is that this is no finding the appsetting.json file within the packet.
Result:
"No files were found that match the replacement target pattern ‘approot\packages\PivotGenericSchedulerID\1.0.182089247\Pivot.Generic.Scheduler.Web\appsettings.json’ "
Within Octopus -> Library I can see my packet id PivotGenericSchedulerID with version
1.0.182089247 as its resolved above. And if I download that packet locally I can see within the root\
Pivot.Generic.Scheduler.Web and within that directory appsettings.json exists.
I have attempted this with patterns:
“approot\appsettings.json”
“approot\Pivot.Generic.Scheduler.Web\appsettings.json”
“appsettings.json”
But all result in a “No files were found that match the replacement target pattern”
Any ideas?
I seen in other posts “Substitute Variables in Files” feature also needs to be enabled - is this related? (and does it explain why the above is not working)
Getting the following warning:
No files were found that match the replacement target pattern ‘approot\packages\PivotGenericSchedulerID\PivotGenericSchedulerID.1.0.182089247\Pivot.Generic.Scheduler.Web\appsettings.json’
Thanks for getting in touch. It should not require you to have Substitute Variables in Files toggled on. You will only need to match on the file path as it is defined within the package, you won’t need to include the package version or any info about where it’s deployed.
Either of these will work, depending on if there are other appsettings.json files in the package in other locations.
To put it another way approot\packages\PivotGenericSchedulerID\ is where it ends up in the end it doesn’t need to form part of your pattern matching to determine the file to be modified.
The key part of the info below where you specify the target files is in bold:
A comma- or newline-separated list of file names to replace settings in, relative to the package contents
If your concern was other previous versions also deployed there they will not be modified by this deployment / file substitution.
Thank you for your detailed answer and example.
I have attempted with **\appsettings.json and found the particular json file in question, working beautifully.