hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.46k stars 4.54k forks source link

Synapse Administrator role Workspace #26154

Open vsotog-Soluciones opened 1 month ago

vsotog-Soluciones commented 1 month ago

Is there an existing issue for this?

Community Note

Terraform Version

1.8.3

AzureRM Provider Version

3.32.0

Affected Resource(s)/Data Source(s)

azurerm_role_assignment

Terraform Configuration Files

resource "azurerm_role_assignment" "synapse_admin" {
  for_each             = data.azuread_user.synapse_admins
  scope                = azurerm_synapse_workspace.default.id
  role_definition_name = "Synapse Administrator"
  principal_id         = each.value.object_id
}

Debug Output/Panic Output

Error: loading Role Definition List: could not find role 'Synapse Administrator'

Expected Behaviour

No response

Actual Behaviour

╷ │ Error: loading Role Definition List: could not find role 'Synapse Administrator' │ │ with azurerm_role_assignment.synapse_admin["vsotog@soluciones.cl"], │ on synapse_workspace.tf line 137, in resource "azurerm_role_assignment" "synapse_admin": │ 137: resource "azurerm_role_assignment" "synapse_admin" {

Steps to Reproduce

terraform plan terraform apply

Important Factoids

No response

References

No response

Chambras commented 1 month ago

Hi @vsotog-Soluciones I think there is a confusion here. azurerm_role_assignment is for built-in roles. If you execute Get-AzRoleDefinition | Format-Table -Property Name, IsCustom, Id , you will see that Synapse Administrator is not here. If you want to manage Synapse role assignments, you might want to take a look at azurerm_synapse_role_assignment