I am trying to create RBAC for web apps under service bus topic. The terraform plan looks good but the apply is failing with the following error
Error: loading Role Definition List: authorization.RoleDefinitionsClient#List: Failure responding to request: StatusCode=404 – Original Error: autorest/azure: error response cannot be parsed: {“” ‘\x00’ ‘\x00’} error: EOF
│
│ with module.test_servicebus[0].azurerm_role_assignment.test_servicebus_roleassignments[“2d141dc9-bf87-4043-8976-100d51db6dd3”],
│ on …..\modules\serviceBus\main.tf line 68, in resource “azurerm_role_assignment” “test_servicebus_roleassignments”:
│ 68: resource “azurerm_role_assignment” “test_servicebus_roleassignments” {
Module Code
resource “azurerm_role_assignment” “test_servicebus_roleassignments” {
for_each = {
for permission in var.custom_service_bus_permissions : permission.principal_id => {
permission = permission
topics = [for topic_name in permission.selectedTopics : azurerm_servicebus_topic.test_servicebus_topics[topic_name].id]
}
}
scope = join(“,”, each.value.topics)
role_definition_name = each.value.permission.role_definition_name
principal_id = each.value.permission.principal_id
depends_on = [
azurerm_servicebus_topic.test_servicebus_topics
]
}