Step 13 - Replace tokens in APIM .xml files - Build
  • 18 Nov 2019
  • 1 Minute to read
  • Contributors
  • Comment
  • Dark
    Light
  • PDF

Step 13 - Replace tokens in APIM .xml files - Build

  • Comment
  • Dark
    Light
  • PDF

Article summary

In the Visual Studio solution I have a project containing xml files which are used for the xml files which contain the APIM policy. In this task we will configure those files so that when we depoy them to APIM they have any settings configured correctly.

In the case of our solution we will be injecting the key value into the policy which will be configured to be set as the x-functions-key header which is passed to the back end function app.

A picture of the configuration for this task is:

image.png

YAML

The yaml for this task is:

steps:
- task: qetza.replacetokens.replacetokens-task.replacetokens@3
  displayName: 'Replace tokens in APIM **/*.xml'
  inputs:
    rootDirectory: '$(Build.ArtifactStagingDirectory)\APIM'
    targetFiles: 'APIM/*.xml'
    tokenPrefix: '__'
    tokenSuffix: '__'



Was this article helpful?