使用VSTS Git作为Spring Cloud Config配置仓库遇NoSuchRepositoryException错误求助
Hey there, sorry you're hitting this NoSuchRepositoryException while trying to hook up VSTS (now Azure DevOps) Git with Spring Cloud Config. Let's walk through the most common fixes and checks to get this working:
1. Double-Check Your Git URI
First off, make sure your SSH URI for the VSTS repo is formatted correctly. It should look something like:git@ssh.dev.azure.com:v3/{your-org-name}/{your-project-name}/{your-repo-name}
- Verify every part of the URI matches exactly—no typos in org, project, or repo names
- If you were testing with HTTPS before, note that SSH uses a different structure, so don't mix them up
2. Validate SSH Private Key & Passphrase
SSH auth is usually the culprit here. Let's rule that out:
- Confirm the private key in your config is the exact RSA key you've added to your Azure DevOps personal settings (you added the public key there, right?)
- Double-check the
passphrasematches the one you set for the private key—watch out for case sensitivity or special characters - Test the key locally first! Try cloning the repo with the same key:
If this fails locally, fix the SSH setup before troubleshooting Spring Config.git clone git@ssh.dev.azure.com:v3/your-org/your-project/your-repo
3. Verify Host Key Configuration
VSTS's SSH host key can be fetched with this command:
ssh-keyscan ssh.dev.azure.com
Make sure the host-key in your application.yml matches the ssh-rsa key returned here exactly—no extra spaces or line breaks. As a quick test (for dev environments only), you can temporarily remove the host-key-algorithm and host-key lines to let Spring auto-trust the host. If that works, you know the host key was the issue.
4. Check Your Search Paths
You've set search-paths: '{application}', which means Spring Config looks for configs in a directory named after your app. Confirm:
- The repo actually has a directory matching your application's name
- That directory contains valid config files (like
application.ymlor{app-name}-{profile}.yml) - If you don't need per-app directories, just set
search-paths: '.'or remove the line entirely to use the repo root.
5. Confirm Repository Permissions
Make sure the Azure DevOps account linked to your SSH key has read access to the repo. Head over to the repo's settings in Azure DevOps, check the permissions, and ensure your account is in a group with read access (like Project Readers).
If none of these work, turn on DEBUG logging for Spring Cloud Config—this will spit out more detailed error messages that can pinpoint exactly where the connection is failing (e.g., auth errors, path issues).
内容的提问来源于stack exchange,提问作者Charles C.

