How do I authorize Azure to checkout git submodules in the repo?

Vallan Sherrod 0 Reputation points
2024-01-31T23:48:11.3+00:00

I am attempting to checkout a repo in an Azure pipeline that has a git submodule in it.

I added the submodules: true flag: User's image

But when it attempts to checkout it out, it thinks it does not have access:
User's image

The submodule repo is in the same project and provider (Bitbucket) as the normal repo, and it should have the same access rights as the first repo it checks out successfully.

I have gotten it to checkout the submodule repo as if it was a main repo by adding it two the resources with my Bitbucket credentials and it pulls it just fine:

User's image

User's image

But it still fails on the checkout when it is a submodule. How do I give permissions to the submodule?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,708 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vallan Sherrod 0 Reputation points
    2024-02-01T16:08:11.7166667+00:00

    Found that private submodules need to be defined relative to the main repo (and therefore, need to be hosted on the same service). See here: https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/pipeline-options-for-git?view=azure-devops&tabs=yaml#checkout-submodules

    0 comments No comments

  2. Vallan Sherrod 0 Reputation points
    2024-02-01T16:09:31.1133333+00:00

    Found that private submodules need to be defined relative to the main repo for Azure to pull them with the same credentials. This was my problem and it worked once I defined it as a relative URL instead of an absolute one. See: https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/pipeline-options-for-git?view=azure-devops&tabs=yaml#checkout-submodules

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.