title: Copy and Rename Config File in Azure Pipelines
body: <p>I have specific config files for specific environments (dev,qa,uat) and another root web.config. The deployed code reads web.config. So I've been trying to either copy the contents or rename the file in Azure Pipelines.</p>
  <pre><code>- task: CopyFiles@2
        displayName: 'Copy Specific Config'
        inputs:
          SourceFolder: 'Client.WebApi.Core/Configs/Web.QA.config'
          TargetFolder: '$(build.artifactstagingdirectory)\MainWebApi'
  
  - task: CmdLine@2
        inputs:
          script: rename $(build.artifactstagingdirectory)\MainWebApi\Web.QA.config 
          $(build.artifactstagingdirectory)\MainWebApi\web.config
  </code></pre>
  <p>Another method:</p>
  <pre><code>- task: PowerShell@2
        inputs:
          targetType: 'inline'
          script: |
            copy-item -path Client.WebApi.Core/Configs/Web.QA.Config -destination Client.WebApi.Core/web.config
            TargetFolder: '$(build.artifactstagingdirectory)/MainWebApi'
  </code></pre>
  <p>I have tried various combinations like renaming then copying and copying and then renaming it, copying the contents into new web.config files etc
  What exactly should be used?</p>