Variable Replacement web.config Azure Cloud Service

I thought it was possible to do transforms and/or variable replacement on web.config files inside an azure cloud service package now and not just the cloudmanager settings. I’ve tried and I can’t get it to replace variables, not detecting any files. I’m trying *.config in the replacement field. Any ideas?

Hi Corey,

Thanks for getting in touch and sorry to hear you’re having difficulties with the variable substitution.

Could I check which feature(s) you have configured for your Cloud Service step? From what you described I suspect you are using the Substitute variables in files feature? If that is the case, *.config will only look for config files in the top folder of the package content, if you use **\*.config it will search all folders.

You could also use the Configure variables feature, which will also search the package for all config files and doesn’t require any setup other than being enabled.

Hope that helps, if not would you be able to send a screenshot of the step setup and the deployment log?


Thanks, I thought it might be something like that, I will give that a try.

If I do the variable replace based off the key name, that one just looks for all configs?

Yeah, the Configure variables essentially does exactly the same thing as Substitute variables in files with **\*.config specified, in that all folders get searched. Substitute variables in files also has some advanced options for file encoding etc, which is where it provides value, but you probably don’t need those.