title: replace tokens during release in azure devops
body: <p>I have a release pipeline to deploy a asp.net core web app. This was created from a simple asp.net web deploy template on azure devops. The web deploy step just points to the .zip file of the artifact drop folder and deploys the app.</p>
  <p>I would like to replace tokens in my appSettings.Staging.json file for example:
  <a href="https://i.stack.imgur.com/i4ZoD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/i4ZoD.png" alt="enter image description here" /></a></p>
  <p>I am using Token Replace marketplace tool: <a href="https://github.com/qetza/vsts-replacetokens-task" rel="noreferrer">https://github.com/qetza/vsts-replacetokens-task</a> and setting it up in a pretty standard way as documented:
  <a href="https://i.stack.imgur.com/7jQ14.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7jQ14.png" alt="enter image description here" /></a></p>
  <p>and setting up my variables in devops:
  <a href="https://i.stack.imgur.com/SNIs3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SNIs3.png" alt="enter image description here" /></a></p>
  <p>I would like the &quot;DummyValue&quot; to be replaced with &quot;ActualValue&quot;.</p>
  <p>Since the artifact is a zip file, I added the &quot;File Extractor&quot; task to unzip the the archive and then had Token Replace task target that folder. According to the logs, it seems like the Token Replace did end up replacing a value, but I can't access those resources directly to make sure.</p>
  <p>Since I am now extracting files, I pointed the web deploy task to the new folder where the unarchived files reside, and it successfully deployed, but the resulting appsettings.Staging.json file still doesn't have the token replaced. In the logs of the deploy job I saw this:</p>
  <p>2021-03-28T07:36:19.6554561Z Package deployment using ZIP Deploy initiated.
  2021-03-28T07:38:08.8457706Z Successfully deployed web package to App Service.</p>
  <p>Seems like it's still using ZIP deployment, and I am not sure where it's finding the zip file as there's nothing in the devops logs for that.</p>
  <p>Just wondering if anybody else has experienced this and what the best way is to go with this.</p>