Review Service Fabric management authentication

Configure authentication and roles for cluster management clients correctly.

Description

To authenticate Azure Service Fabric management clients with Microsoft Entra ID, identify the tenant and both registered applications. You can also control client access with X.509 certificates.

Potential impact

A missing tenant ID prevents deployment of the Entra configuration. An incorrect role assignment can give a user cluster administrator access.

Remediation

Set tenant_id, cluster_application_id and client_application_id in azure_active_directory. Assign the administrator and user roles, then test access as each. For certificate-based access, verify which client certificates are trusted and which roles they receive.

Examples

The first example omits the required tenant_id. For deployment, also supply a supported cluster version, an HTTPS management endpoint, and the node and cluster certificate settings.

Before

hcl
resource "azurerm_service_fabric_cluster" "example" {
  name                 = "example-servicefabric"
  resource_group_name  = azurerm_resource_group.example.name
  location             = azurerm_resource_group.example.location
  reliability_level    = "Bronze"
  upgrade_mode         = "Manual"
  cluster_code_version = var.cluster_code_version
  vm_image             = "Windows"
  management_endpoint  = var.management_endpoint

  azure_active_directory {
    cluster_application_id = var.cluster_application_id
    client_application_id  = var.client_application_id
  }
}

After

hcl
resource "azurerm_service_fabric_cluster" "example" {
  name                 = "example-servicefabric"
  resource_group_name  = azurerm_resource_group.example.name
  location             = azurerm_resource_group.example.location
  reliability_level    = "Bronze"
  upgrade_mode         = "Manual"
  cluster_code_version = var.cluster_code_version
  vm_image             = "Windows"
  management_endpoint  = var.management_endpoint

  azure_active_directory {
    tenant_id              = var.tenant_id
    cluster_application_id = var.cluster_application_id
    client_application_id  = var.client_application_id
  }
}

References