title: Authenticating with Azure Repos git module sources in an Azure Pipelines build
body: <p>I'm currently creating a pipeline for Azure DevOps to validate and apply a Terraform configuration to different subscription.</p>
  
  <p>My terraform configuration uses modules, those are "hosted" in other repositories in the same Azure DevOps Project as the terraform configuration.</p>
  
  <p>Sadly, when I try to perform <code>terraform init</code> to fetch those modules, the pipeline task "hang" there waiting for credentials input. </p>
  
  <p>As recommanded in the <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/git-commands?view=vsts&amp;tabs=yaml" rel="nofollow noreferrer">Pipeline Documentation on Running Git Commands in a script</a> I tried to add a <code>checkout</code> step with the <code>persistCredentials:true</code> attribute.</p>
  
  <p>From what I can see in the log of the task (see bellow), the credentials information are added specifically to the current repo and are not usable for other repos.</p>
  
  <p><strong>The command performed when adding <code>persistCredentials:true</code></strong></p>
  
  <pre><code>2018-10-22T14:06:54.4347764Z ##[command]git config http.https://my-org@dev.azure.com/my-org/my-project/_git/my-repo.extraheader "AUTHORIZATION: bearer ***"
  </code></pre>
  
  <p><strong>The output of terraform init task</strong></p>
  
  <pre><code>2018-10-22T14:09:24.1711473Z terraform init -input=false
  2018-10-22T14:09:24.2761016Z Initializing modules...
  2018-10-22T14:09:24.2783199Z - module.my-module
  2018-10-22T14:09:24.2786455Z   Getting source "git::https://my-org@dev.azure.com/my-org/my-project/_git/my-module-repo?ref=1.0.2"
  </code></pre>
  
  <p>How can I setup the git credentials to work for other repositories ?</p>