1
votes

I am trying to deploy a VSTS (Visual Studio Team Services) Git app including submodules to Azure using the Deployment source option in the Azure web app.

All submodules are hosted in the same VSTS project but under different Git repositories.

The deployment to Azure fails with the following error message:

fatal: could not read Username for 'https://XXX.visualstudio.com': Bad file descriptor\nClone of 'https://XXX.visualstudio.com/defaultcollection/Project/_git/Project.API.Models' into submodule path 'lib/api-models' failed\n\r\nD:\Program Files (x86)\Git\cmd\git.exe submodule update --init --recursive

Is there any way to deploy Git projects including submodules to Azure?

1

1 Answers

5
votes

So I figured out a workaround on how to make git deployments on Azure work with submodules.

  1. Create a personal access token by clicking on clone in VSTS and then personal access token.
  2. Copy the access token and modify the URL of all submodules in the .gitmodules files.
  3. The url of the git modules should look like this afterwards: https://deployment:[email protected]/defaultcollection/Project/_git/Project.API.Models

Make sure you paste the API key in all submodules and submodules of submodules. Commit and push and you are good to go. The username deployment in this case can be any random name.