Skip to content

Terraform will default to system-assigned managed identity when use_msi is set instead of user-assigned managed identity #563

@mikegigawatt

Description

@mikegigawatt

Is your feature request related to a problem? Please describe.

When running Terraform docker image on a VM that has a system assigned managed identity as well as a user assigned managed identity, Terraform will use the system assigned managed identity by default, per https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/managed_service_identity as well as my actual testing. If you want to instead use the user-assigned managed account, it's required to also set the client_id variable to point to the user assigned managed account.

Describe the solution you'd like

The documentation for setting up authentication should be updated to include this notice - that with the example provided the VM system assigned managed identity will be used, but if the created or configured existing user assigned managed identity is required to be used instead, the TF_VAR_client_id field should be included in the credentials file to point it to the user assigned managed identity. The TF_VAR_client_secret field should not be set.

Describe alternatives you've considered

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestnewAdded to an issue when it's new ;)staleOpen for 30 days with no activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions