Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ForceNew on azuredevops_serviceendpoint_azurerm #387

Closed
hbuckle opened this issue May 18, 2021 · 4 comments
Closed

ForceNew on azuredevops_serviceendpoint_azurerm #387

hbuckle opened this issue May 18, 2021 · 4 comments

Comments

@hbuckle
Copy link
Contributor

hbuckle commented May 18, 2021

After importing an existing AzureRM service endpoint terraform plan shows it needs to be replaced due to credentials. Is this correct behaviour? It should be possible to update the credentials of the service endpoint without replacing it?

  # azuredevops_serviceendpoint_azurerm.manual_workaround must be replaced
-/+ resource "azuredevops_serviceendpoint_azurerm" "manual_workaround" {
      ~ authorization             = {
          - "scheme" = "ServicePrincipal"
        } -> (known after apply)
        azurerm_spn_tenantid      = "***"
        azurerm_subscription_id   = "***"
        azurerm_subscription_name = "staging"
      + description               = "Managed by terraform-sql_server"
      ~ id                        = "***" -> (known after apply)
        project_id                = "***"
        service_endpoint_name     = "cbuk-core-staginggreen-sql-manualworkaround"

      + credentials { # forces replacement
          + serviceprincipalid       = "***"
          + serviceprincipalkey      = (sensitive value)
          + serviceprincipalkey_hash = (sensitive value)
        }

      - timeouts {}
    }
@xuzhang3
Copy link
Collaborator

Hi @hbuckle This is the right behavior. Recreation service connection will have a new ID which may broken your current CI/CD.
I try remove the force new flag and it works too, looks there's no need to renew a new service connection when credentials changed, this can an update of the API but ADO provider not updated.

@hbuckle
Copy link
Contributor Author

hbuckle commented May 20, 2021

@xuzhang3 - I can raise a PR to remove the ForceNew so credentials can be updated?

@xuzhang3
Copy link
Collaborator

@hbuckle Remove the credentials.ForceNew and you can build a private package and test it, you will find that Terraform will only update the credentials not create a new one.

@xuzhang3
Copy link
Collaborator

Close this issue, feel free to open another issue if you have questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants