I need to pass some connection string to update my web.config file for the IIS deployment

Hello,

I need to pass some connection string to update my web.config file for the IIS deployment.

I tried various method using xml parameters but no luck.

Need a help that how can i pass the connection string using the recipe.

Thanks in advance

create a template out of the .config file and create an attribute for the connection string, then pass the connection string to your attribute during the chef run. also, you can place the config with the new value during the run…

1 Like

Can you please elaborate more on this with an example.

Thanks in advance

You asked the same question already here:

web.config files are hard to manage using config managment because they change so frequently. If you try and put it ias a template, you will run into backwards compatibility problems.. The microsoft recommended way is to use appcmd.exe

The iis_config resource in the IIS cookbook can execute appcmd.exe commands, or use apowershell_script resource.