Hi - We use Azure DevOps and would like to integra...
# permit-saas
s
Hi - We use Azure DevOps and would like to integrate it with Permit, to manage policies. I tried following the documentation for GitHub, replacing SSH with RSA for ADO. But the call for configuring Permit to use my repo fails with error - Invalid git URL, please provide SSH URL for the repository. I am providing the SSH url as per the format - git@ssh.dev.azure.com:v3/OrganizationName/ProjectName/RepoName. Any help will be appreciated.
a
Hi @Shyamalan Chemmery, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
The available documentation focuses on GitHub, GitLab, and Bitbucket integration (1) . While the guide mentions that "the same steps can be applied to other Git providers that supports SSH deploy keys with minor modifications" , there isn't specific guidance for Azure DevOps in the sources. For the SSH URL format, the documentation shows examples like
git@github.com:yourorg/policies.git
(2) for GitHub. Azure DevOps uses a different SSH URL format than the standard Git providers documented. The error message "Invalid git URL, please provide SSH URL for the repository" suggests Permit.io's validation might be expecting a different SSH URL format. Azure DevOps SSH URLs typically follow the pattern you mentioned:
<mailto:git@ssh.dev.azure.com|git@ssh.dev.azure.com>:v3/OrganizationName/ProjectName/RepoName
. A few things to verify: 1. Ensure your SSH private key was generated without a passphrase, as this is required (3) 2. The repository must have a default branch with at least one commit on the remote (1) (4) 3. The SSH key should be configured with appropriate access permissions in Azure DevOps Since the available documentation doesn't cover Azure DevOps specifically, I'd recommend reaching out over Email with: • The exact SSH URL format you're using • The error response details • Your Azure DevOps repository configuration They can provide specific guidance for Azure DevOps integration and may need to update their validation to support the ADO SSH URL format.
To learn more, see the sources I considered: [[1] Git and Permit](https://docs.permit.io/integrations/gitops/github) [[2] Quick Start Guide](https://docs.permit.io/how-to/deploy/on-prem/quick-start) [[3] Docs - mention that repo ssh key should have no passphrase](https://github.com/permitio/opal/issues/421) [[4] Installation Guide](https://docs.permit.io/how-to/deploy/on-prem/installation)
o
Hi we haven't tested against AzureDevops, but if you configure things on the AzureDevops side to support standard SSH I'd expect it to work. I'm afraid this is the best we can currently offer as part of the community support.
s
Thanks @Or Weis. ADO supports SSH with RSA key. So instead of generating SSH key pair with... ssh-keygen -t ecdsa -b 521 -C "help@permit.io" I generate it with type RSA... ssh-keygen -t rsa -b 4096 -C "help@permit.io" The ADO equivalent of setting "Depoly key" in GitHub is setting "SSH Public keys" in User Settings. I have done that and am calling the API, with SSH url provided by ADO. But the call is failing with the said error.
d
Hi @Shyamalan Chemmery as Or said we havent tested against AzureDevops so support may be a bit limited here. But if you could send over the following items we can try to help troubleshoot: 1. The complete JSON configuration you're sending (with sensitive data redacted) 2. The exact API call (as SDK code or CURL) 3. The full error response 4. Confirmation that SSH connectivity to Azure DevOps works from your environment
šŸ‘ 1
s
Thanks @david. The CURL with JSON data is... curl --location 'https://api.permit.io/v2/projects/<Project Id>/repos' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer permit_key_<Project key>' \ --data-raw '{ "url": "git@ssh.dev.azure.com:v3/<My Org>/<My Project>/PermitTest", "main_branch_name": "main", "credentials": { "auth_type": "ssh", "username": "git", "private_key": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3Bl...AgMEBQ==\n-----END OPENSSH PRIVATE KEY-----\n" }, "key": "<Project Id>" }' The response is - 422 Unprocessable Entity (WebDAV) (RFC 4918) { "detail": [ { "loc": [ "body", "url" ], "msg": "Invalid git URL, please provide SSH URL for the repository", "type": "value_error" } ], "body": { "url": "git@ssh.dev.azure.com:v3/<My Org>/<My Project>/PermitTest", "main_branch_name": "main", "credentials": { "auth_type": "ssh", "username": "git", "private_key": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3Bl...AgMEBQ==\n-----END OPENSSH PRIVATE KEY-----\n" }, "key": "<Project Id>" } } I have tested SSH connectivity locally and it works
d
Thank you @Shyamalan Chemmery. Have you tried different URL variations like the bot suggested? Try these URLs in your data-raw in the curl: 1. "git@ssh.dev.azure.com:v3/<My Org>/<My Project>/PermitTest.git" 2. "ssh://git@ssh.dev.azure.com/v3/<My Org>/<My Project>/PermitTest" 3. "ssh://git@ssh.dev.azure.com/v3/<My Org>/<My Project>/PermitTest.git"
s
All the above URLs results in the same response. Thanks.
@david this issue has been resolved. The problem was a blank space in the SSH URL (the project name). I tested with another ADO project (which has no space in the project name) and it worked. Thanks for your help.
āœ… 1
šŸ™Œ 1