It's unnecessary to provider SSH Key to Azure DevOps, you just need to modify the .gitmodules
file in the private bitbucket repo to specify the submodule github repo URL with HTTP protocol.
Such as modify the .gitmodules
file as:
[submodule "myrepo"]
path = myrepo
url = https://github.com/username/myrepo.git
Now, when you queue the build again, it will download the submodule repo successful in Get sources (checkout) step.
While for the reason why it mainly build failed at Get sources step, it's caused the build agent does not have the SSH key which matches in Github, when get the soubmodule sources. So if you do not want to modify .gitmodules
file with HTTP protocol, you should to queue the build which the self-hosted agent which contains the ssk public key you specified in GitHub.
Detail steps to setup a self-hosted agent as below:
- Create and copy a PAT in the page https://account.visualstudio.com/_usersSettings/tokens for later use. If you already have PAT, then skip this step.
Download agent
In Agent pools page (https://account.visualstudio.com/_settings/agentpools) -> download agent to the local machine where GitHub repo SSH locates -> unzip in a directory.
Setup self-hosted agent
In the unzipped directory -> open PowerShell as Administrator -> execute ./config.cmd
-> enter URL, PAT, agent pool (such as Default agent pool) etc as it hints.
After configuration -> if the agent is offline line -> execute ./run.cmd
in the PowerShell window to make sure the agent state is Online.
Now you can queue build with your self-hosted agent.