Skip to content

Issues with Managed Identity users #129

@waylew50

Description

@waylew50

I am trying to figure out what I am doing wrong when I try to create a user from an azure resource system managed identity, I tried using the mssql_azuread_service_principal which says it supports managed identity. It will create the user, but when I test that resources access I get a login failed for principal.

here is the terraform I am using:

resource "mssql_azuread_service_principal" "principal" {
        name        = data.azurerm_virtual_machine_scale_set.WriterBuildAgent.name
       client_id   = data.azurerm_virtual_machine_scale_set.WriterBuildAgent.identity[0].principal_id
       database_id = var.azure_sql_database_id
}

I noticed when I compare the outputs from the azurerm principal_id and the mssql_azuread_service_principal.client_id they do not match. the client_id produces a value that I cannot find on the resource. I also tried the mssql_azuread_user resource, but it produced the same error.

other then that, I love the provider!

please advise.
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions