title: Managing Refresh Tokens for Scheduled Data Factory Copy Activity from API
body: <p>I need some help.</p>
  <p>I am building a pipeline in Data Factory which copies data from an external API and I need some help managing the refresh tokens to make the pipeline automated. Is anyone able to help me with the following questions:</p>
  <ul>
  <li>How I can add a new version of a secret to Azure Key Vault based on the output of a pipeline activity. I know how to access the the refresh token value from a previous pipeline activity using dynamic content but not how to set the new value in the key store.</li>
  <li>If the above line is successful, is it possible to create a variable that accesses the latest version of a secret?</li>
  <li>Is it possible to automate deleting of previous key versions based on time (e.g. delete all from 2 days ago) or based on number (delete the keys so that only the 10 most recent remain).</li>
  </ul>
  <p>You guys are awesome. Thanks in advance.</p>
  <p>Thomas</p>