Variable Replacement web.config Azure Cloud Service

corey's Avatar


17 Jul, 2017 07:05 PM

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?

  1. Support Staff 1 Posted by Shannon Lewis on 18 Jul, 2017 02:18 AM

    Shannon Lewis's Avatar

    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?


  2. 2 Posted by corey on 18 Jul, 2017 02:21 AM

    corey's Avatar

    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?


  3. Support Staff 3 Posted by Shannon Lewis on 18 Jul, 2017 05:37 AM

    Shannon Lewis's Avatar

    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.


  4. Paul Stovell closed this discussion on 01 Nov, 2017 02:33 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac