Problem
After you set up the Azure DevOps Services VCS integration, workspace creation and private registry module publication fails to complete. This will manifest in the following symptoms:
- New workspaces remain stuck in the "Checking for configuration" status.
- Newly published private registry modules display the error: "The module "
" for provider " " failed to setup. Please verify that the module follows the correct structure." - Changes to the VCS repositories in Azure DevOps Server do not reflect in existing workspaces or private registry modules.
In Terraform Enterprise, Sidekiq logs a Clone url can't be blank error when attempting to retrieve the clone URL from the Azure DevOps Server API.
For workspace creation, the log appears as follows.
2023-08-17T16:53:50.503Z pid=1 tid=2kvx WARN: ActiveRecord::RecordInvalid: Validation failed: Clone url can't be blank
For private registry module publication, the log appears as follows.
2023-08-17 16:26:30 [ERROR] msg=Failed performing initial module version ingress registry_module=3 exception=Validation failed: Clone url can't be blank
Cause
The Azure DevOps integration requires you to enable SSH. As part of the ingress process, HCP Terraform or Terraform Enterprise will make an API request to the Repositories - Get API and extract the sshUrl to use as the clone URL for the ingress job. If the SSH server is not enabled, this attribute will not be present in the API response and will result in the validation error.
Solution
You must enable the Azure DevOps SSH server. To do this, navigate to the Azure DevOps Server Administration Console and enable SSH under Application Tier.
Once complete, follow the SSH key configuration steps in the setup documentation to create an SSH key pair, add the private SSH key to the VCS connection in HCP Terraform or Terraform Enterprise, and add its corresponding public key to Azure DevOps Server.