Introduction
Problem
The following event type of Azure DevOps Webhook subscriptions are created when configuring a Workspace from Terraform Enterprise and Terraform Cloud to associate with Azure DevOps Service repository, however, prior to May 2021, those Service Hooks registrations do not appear in Azure DevOps:
- git.pullrequest.created
- git.pullrequest.updated
- git.push
Causes
Azure DevOps expects the Project Id to be included in the payload when creating Webhook Subscription on a repository.
Solutions:
Terraform Enterprise
-
Upgrade to release v202105-1 or higher
-
Disassociate all workspaces, modules, or policy sets from the VCS repository, for workspace, this can be done via updating the VCS connection configuration under Settings -> Version Control -> Change Source, then selecting any other source which is not VCS. For module, it needs to be deleted, and the policy set also requires the same process.
-
Reconnect workspace to VCS repository, and/or recreate modules and policy sets.
Terraform Cloud
- Perform the same steps as Terraform Enterprise except for the upgrade.
Outcome
The Webhook subscriptions should now display under the Service Hooks section on the Project Settings page.
Additional Information
- These are the APIs used by Terraform Enterprise and Cloud to create and remove Webhook subscriptions:
- To recreate Webhook subscription, it is required for all Workspaces, Modules, and Policy Sets to disconnect from the VCS repository before starting to reconnect those components back to the VCS repository. The complete disconnection will trigger the process in Terraform Enterprise/Cloud to destroy Webhook subscriptions.