Hi,
I am deploying web api project by creating its nuget package and pushing to octopus using tfs. Octopus is deploying this package to appropriate web server successfully. This package contains web.config which has section called as MessageConfig which contain items which has parameters like TypeName , Enabled, Secrete as follows :
I want to add this Messageconfig item dynamically on release without doing changes in web.config or in web.release.config so that no package is created each time.
Solution to this is I have done is like created loop script in web.release.config as follow :
#{each item in MessageConfigList} #{/each}and created appropriate variables in octopus as follows :
Name - value
MessageConfigList[1].TypeName - "TestEvent1"
MessageConfigList[1].Secret - "XXX"
MessageConfigList[1].Enabled - "true"
MessageConfigList[2].TypeName - "TestEvent2"
MessageConfigList[2].Secret - "YYY"
MessageConfigList[2].Enabled - “false”
which will add following to web.config when I create release :
But with this if I want to add 100 items then I have to create 300 variables and in that also if environment is different then have to create variable accordingly.This become very hectic. Can you please suggest some alternate solution to this ?
Thanks,
Dipika