Expansion of environment variables in attributes of web.config elements is already taken care of by IIS itself. It is controlled with the IIS configuration schema for the iisnode element here: https://github.com/tjanczuk/iisnode/blob/master/src/config/iisnode_schema_x64.xml#L33. As such, this call can be removed along with the overload of GetEnvExpandedString that operates on web.config artifacts.