terraform-provider-azuredevops icon indicating copy to clipboard operation
terraform-provider-azuredevops copied to clipboard

New Resource: Azure Service Connection for Visual Studio Marketplace

Open Danielkem opened this issue 3 years ago • 6 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Similar to other service endpoints, it would be helpful to be able to describe a Visual Studio Marketplace service connection. When describing it as a generic service connection it is successfully imported and when running terraform plan it does not complain. However, if you try to apply a change it fails with the following error:

The pipeline is not valid. Job Job1: Step PublishAzureDevOpsExtension input connectedServiceName expects a service connection of type VstsMarketplacePublishing but the provided service connection serviceendpoint is of type generic.

New or Affected Resource(s)

  • azuredevops_serviceendpoint_visualstudiomarketplace

Potential Terraform Configuration

resource "azuredevops_project" "project" {
  name               = "Sample Project"
  visibility         = "private"
  version_control    = "Git"
  work_item_template = "Agile"
}

resource "azuredevops_serviceendpoint_visualstudiomarketplace" "serviceendpoint" {
  project_id            = azuredevops_project.project.id
  marketplace_url       = "https://some-server.example.com"
  personal_access_token = "Personal access token"
  service_endpoint_name = "Sample Generic"
  description           = "Managed by Terraform"
}

Danielkem avatar Oct 28 '21 10:10 Danielkem

When describing it as a generic service connection it is successfully imported and when running terraform plan it does not complain. However, if you try to apply a change it fails with the following error:

The pipeline is not valid. Job Job1: Step PublishAzureDevOpsExtension input connectedServiceName expects a service connection of type VstsMarketplacePublishing but the provided service connection serviceendpoint is of type generic.

Sounds like a bug to me...

lindhe avatar Oct 29 '21 07:10 lindhe

@lindhe All service connection have fixed type and parameter scheme, the generic service connection won't to able to handle this new service connection.

xuzhang3 avatar Nov 01 '21 02:11 xuzhang3

I agree that it is unreasonable to have a visualstudiomarketplace type service connection handled by a generic service connection type Terraform object. That's why I consider it a bug that Daniel was able to successfully terraform import the object and run terraform plan without an issue.

lindhe avatar Nov 01 '21 06:11 lindhe

@lindhe Different service connection may have same parameter structure, but the type is different, this may be the reason why you can apply the import and plan command.

xuzhang3 avatar Nov 01 '21 07:11 xuzhang3

Would it be possible for the provider to catch that earlier, before terraform apply?

lindhe avatar Nov 01 '21 07:11 lindhe

@lindhe I need do some investigation to figured if we can trigger the error earlier, eg tarraform plan.

xuzhang3 avatar Nov 01 '21 07:11 xuzhang3